[Top][All Lists]

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

RE: [lwip-users] http_sent cb shows 1 byte trailer [RAW]

From: Simon Goldschmidt
Subject: RE: [lwip-users] http_sent cb shows 1 byte trailer [RAW]
Date: Wed, 12 Aug 2009 14:49:48 +0200

> Maybe we can collaborate - I did a crude "git er done" GET and POST
> handler
> practically hard coded for a demo.  I want GET and POST to be able to
> reference (easily if possible) C variables - updating on a POST and
> returning on a GET.

I thought of something like that, also. The problem is memory usage (or tcp raw 
API limitations?): currently, the httpd returns static memory (i.e. tcp doesn't 
need to copy). With variables in it, tcp would have to copy, but we'd need to 
create the page before that. This would mean we need the memory twice (1. 
create the char[] containing the file and 2. tcp copies it into pbufs).

To prevent that, we'd have to move from such a char[] to a callback that 
generates the bytes we need before passing them to tcp_write (is that what 
Luminary did?), but that's quite hard.

Therefore, we could allocate the memory using mem_malloc (maybe in blocks?), 
let tcp_write not copy it and then free the memory when tcp_sent tells us the 
data has been sent...

> I was trying to get Luminary's httpd port running and
> had trouble.  It has some interesting and worthwhile concepts.  One is a
> callback to the app as it needs data to fill in.  I was headed toward a
> fixed table of data which contains fields for the type and how to format
> the
> output.  I was thinking of using e.g. the printf/scanf specifiers and use
> them to format incoming and outgoing data.  There are a lot of ways to do
> this of course.

I like the idea. I'm currently in the process of restructuring the code of 
httpd.c in contrib, but I want to wait until after the release before 
committing it.

Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

reply via email to

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