[INFO] lwIP version 2.0 Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] lwIP version 2.0

Post 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
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] lwIP version 2.0

Post by Giovanni »

If I remember well there were issues, you will not be able to remove all patches.

Giovanni
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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.
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] lwIP version 2.0

Post by Giovanni »

I don't like much having to manually redefine things in lwipopts.h.

Giovanni
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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.
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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 :).
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] lwIP version 2.0

Post by Giovanni »

Prepare the patch then I will comment.

Giovanni
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: [INFO] lwIP version 2.0

Post 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"
Attachments
httpd_opts_patch.zip
(23.05 KiB) Downloaded 606 times
Post Reply