[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Serving httpd files sequentially

From: nkarakotas
Subject: Re: [lwip-users] Serving httpd files sequentially
Date: Tue, 2 Apr 2013 19:15:45 -0400 (EDT)


By the way I'm using lpc1769 and the lwip stack size is only 5000 so I believe 
that you can tweak it better. I serve multiple pages size of 30k. You want be 
left with much ram to do other things.


-----Original Message-----
From: "Marshall Brown" <address@hidden>
Sent: Tuesday, April 2, 2013 6:21pm
To: "address@hidden" <address@hidden>
Subject: Re: [lwip-users] Serving httpd files sequentially

lwip-users mailing list
https://lists.nongnu.org/mailman/listinfo/lwip-usersAfter writing this post it 
made me think that the fault was not in the LWIP configuration but in the way 
that I was handling the file system. I was reusing the same file handle for all 
of the files, rather than creating a new handle for each requested file.

I think that it now works. Well my test page is loading correctly.

For what it is worth and reading on internet posts other peoples issues, I can 
confirm that it absolutely possible to serve uncompressed html, pdf or any 
other files of any size from an SD card using LWIP and limited RAM.

I used the Xilinx app note xapp1026.pdf as the basis for my web server, it was 
extremely simple to follow.  And easy enough to port to the NXP device and EFSL 

Thanks for reading.

From: Marshall Brown
Sent: Tuesday, 2 April 2013 9:43 p.m.
To: 'address@hidden'
Subject: Serving httpd files sequentially

Hi there

I have LWIP 1.4.1 successfully running on an LPC1768 with no OS, I have used 
the upper 32 of RAM (of a total of 64k) for LWIP with the following options set 
(check the attached lwipopts.h for further settings)
#define MEM_SIZE                    (31 * 1024)
#define MEMP_MEM_MALLOC             1     //MKB added to try and clean up the 
memory a bit

My understanding of the above define "MEMP_MEM_MALLOC" puts everything on the 
heap, which is fine for my application

I am trying to serve a standard web page from an SD card, the page has links to 
3 or 4 image files. I've tried so many versions of contrib httpd and they all 
come unstuck when the browser requests "GET /file 1" followed by "GET /file 2" 
when LWIP is still serving or ACK the first file. I'm not sure if it is a 
function of LWIP or the SD card (EFSL) that is not happy, but the files are 
coming out corrupted.

I would like to know if there is a way to prevent the browser from requesting a 
file before the web server has finished serving the previous one? I have tried 
the following options (as well as MANY others)
#define TCP_LISTEN_BACKLOG          1     //Default = 0 == off 0 means 
"disabled". In this case, backlog is limited by the number of PCBs.
                                                              //this means we 
use all our memory up accepting listening pcb's then can't service them so we 
limit to 1


But the PCBs remain in the CLOSE-WAIT state for such a long time they can't be 

The screen shot below shows the files being served and the subsequent 
corruption. Any help would be appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]