lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #10273] Add tcp_enqueue_pbuf


From: Simon Goldschmidt
Subject: [lwip-devel] [task #10273] Add tcp_enqueue_pbuf
Date: Tue, 16 Mar 2010 20:32:09 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2) Gecko/20100115 Firefox/3.6

URL:
  <http://savannah.nongnu.org/task/?10273>

                 Summary: Add tcp_enqueue_pbuf
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Di 16 Mär 2010 20:32:08 GMT
                Category: None
         Should Start On: Di 16 Mär 2010 00:00:00 GMT
   Should be Finished on: Di 16 Mär 2010 00:00:00 GMT
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
                  Effort: 0.00

    _______________________________________________________

Details:

Currently, the SSI code in the raw-API httpd allows the application to
generate data to be included in special html files. This is implemented by
first malloc'ing a buffer, generating data into it and then passing this
buffer to tcp_write.

I think it would be nicer to let the server generate a pbuf which can be
filled with the data and pass that pbuf to tcp_write_pbuf: that way, it
doesn't have to track the sent-callback to know when to free its buffer.

Plus we prevent the need for an extra malloc, and either prevent copying the
data from the http-buffer into a PBUF_RAM or prevent pbuf chains when sending
no-copy by using a PBUF_REF.

I already have a simple version of this working: every call creates exactly
one segment. The downside of the 'full' version would be that it can't share
much code with tcp_write, aside from the initial checks - especially creating
correctly sized segment from a pbuf chain would be doing the same as tcp_write
but for pbufs, not for a dataptr.

For me (that is, for the httpd), the simple version would be enough: it's
pretty small and if not used, the code shouldn't grow compared to now).




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?10273>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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