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

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Tue 16 Mar 2010 08:32:08 PM UTC  
 
Category: TCPShould Start On: Tue 16 Mar 2010 12:00:00 AM UTC
Should be Finished on: Tue 16 Mar 2010 12:00:00 AM UTCPriority: 5 - Normal
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenPlanned 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>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Jan 2013 08:22:12 AM UTCgoldsimonCategoryNone=>TCP

    Back to the top


    Powered by Savane 3.1-cleanup1