tasklwIP - A Lightweight TCP/IP stack - Tasks: task #10273, Add tcp_enqueue_pbuf

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #10273: Add tcp_enqueue_pbuf

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Tue 16 Mar 2010 08:32:08 PM UTC
   
 
Category:  TCP Should Start On:  Tue 16 Mar 2010 12:00:00 AM UTC
Should be Finished on:  Tue 16 Mar 2010 12:00:00 AM UTC Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Percent Complete:  0%
Open/Closed:  Open Planned Release:  None
Effort:  0.00

Tue 16 Mar 2010 08:32:08 PM UTC, original submission:  

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).

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-15 goldsimon CategoryNone TCP

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code