[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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [INFO] lwIP version 2.0

Postby Giovanni » Tue Mar 13, 2018 11:42 am

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: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Tue Mar 13, 2018 1:20 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [INFO] lwIP version 2.0

Postby Giovanni » Tue Mar 13, 2018 1:39 pm

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

Giovanni

ych
Posts: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Tue Mar 13, 2018 1:49 pm

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: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Wed Mar 14, 2018 8:15 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [INFO] lwIP version 2.0

Postby Giovanni » Wed Mar 14, 2018 8:23 am

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

Giovanni

ych
Posts: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Wed Mar 14, 2018 9:35 am

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: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Thu Mar 15, 2018 6:34 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [INFO] lwIP version 2.0

Postby Giovanni » Thu Mar 15, 2018 8:31 am

Prepare the patch then I will comment.

Giovanni

ych
Posts: 33
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 7 times
Been thanked: 9 times

Re: [INFO] lwIP version 2.0

Postby ych » Sat Mar 17, 2018 11:35 am

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 192 times


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 16 guests