Page 8 of 9
Re: [INFO] lwIP version 2.0
Posted: Tue Mar 13, 2018 11:42 am
by Giovanni
The real problem is that we have to do patching in first place. Ideally it should be used as-is without touching the source tree at all.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Tue Mar 13, 2018 1:20 pm
by ych
Exactly! That is why I propose to revert current patch of fs.c in bunded lwip and introduce lwiphttpdopts.h with nessery redefinitions of default defines in projects which use httpd application.
If you agree with my proposal then I could prepare the patch for it.
Re: [INFO] lwIP version 2.0
Posted: Tue Mar 13, 2018 1:39 pm
by Giovanni
If I remember well there were issues, you will not be able to remove all patches.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Tue Mar 13, 2018 1:49 pm
by ych
Yes sure (I make diff to original lwip and see that there some patching of sync primitive usage), I have in mind only the patch in fs.c.
Re: [INFO] lwIP version 2.0
Posted: Wed Mar 14, 2018 8:15 am
by ych
I just revert you patch of
fs.c in bundled lwip:
Code: Select all
diff --git a/ext/lwip/src/apps/httpd/fs.c b/ext/lwip/src/apps/httpd/fs.c
index 335bddd..84ab03c 100644
--- a/ext/lwip/src/apps/httpd/fs.c
+++ b/ext/lwip/src/apps/httpd/fs.c
@@ -30,9 +30,7 @@
*
*/
-/* CHIBIOS FIX */
-//#include "lwip/apps/httpd_opts.h"
-#include "httpd_opts.h"
+#include "lwip/apps/httpd_opts.h"
#include "lwip/def.h"
#include "lwip/apps/fs.h"
#include "fsdata.h"
And redefine necessary default defines of httpd in my project's
lwipopts.h. Everything work as expected.
Also, I checked three demo projects that have the copy of
httpd_opts.h (RT-STM32-LWIP-FATFS-USB, RT-STM32F107-OLIMEX_P107-LWIP, RT-STM32F107-OLIMEX_P107-LWIP) and no one redefine any default defines in it (only RT-STM32-LWIP-FATFS-USB-HTTPS have different line ending for some reason).
So if you revert patch of
fs.c in bundled lwip and remove unnessery
httpd_opts.h configs in demo projects then everthins still works as previously.
Re: [INFO] lwIP version 2.0
Posted: Wed Mar 14, 2018 8:23 am
by Giovanni
I don't like much having to manually redefine things in lwipopts.h.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Wed Mar 14, 2018 9:35 am
by ych
As I already mention current demo projects do not redefine anything form httpd_opts.h. And it is possible to use the separate header with all httpd option by with custom name, for example, lwiphttpd_opts.h or lwiphttpdopts.h. And just inclue this header from lwipopts.h.
In any case, the current state of demo projects and bundled/patched lwip is mistaken. Because if you redefine anything in demo project's httpd_opts.h then it will not apply to httpd apps (the reason I describe early).
To fix it we have two options:
- apply the same patch as for fs.c to fsdata.h and httpd.h
- revert patch in fs.c and use project's httpd options header by include it from lwipopts.h
For me, last option is preferred.
Re: [INFO] lwIP version 2.0
Posted: Thu Mar 15, 2018 6:34 am
by ych
Giovanni, if you agree with last option then I could create a patch (of course it is rather trivial).
Also, I have one more proposal for httpd defines header name -
lwipopts_httpd.h 
.
Re: [INFO] lwIP version 2.0
Posted: Thu Mar 15, 2018 8:31 am
by Giovanni
Prepare the patch then I will comment.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Sat Mar 17, 2018 11:35 am
by ych
The first version of path attached.
I am not sure about the correctness of license header, so please make necessary modification.
Also in RT-STM32-LWIP-FATFS-USB-HTTPS demo, it seems
lwipopts.h was for previous lwip version, so I update it to the common form. (Currently, this demo does not compile because of
conflicting types for 'time_t').
I want to mention that current
HTTPD_SERVER_AGENT definition does not have actual effect because of
LWIP_HTTPD_DYNAMIC_HEADERS disabled and demo fsdata burn server agent header value in files.
Update:
In bundled lwip version one ChibiOS patch must be reverted:
Code: Select all
diff --git a/ext/lwip/src/apps/httpd/fs.c b/ext/lwip/src/apps/httpd/fs.c
index 335bddd..84ab03c 100644
--- a/ext/lwip/src/apps/httpd/fs.c
+++ b/ext/lwip/src/apps/httpd/fs.c
@@ -30,9 +30,7 @@
*
*/
-/* CHIBIOS FIX */
-//#include "lwip/apps/httpd_opts.h"
-#include "httpd_opts.h"
+#include "lwip/apps/httpd_opts.h"
#include "lwip/def.h"
#include "lwip/apps/fs.h"
#include "fsdata.h"