buglwIP - A Lightweight TCP/IP stack - Bugs: bug #46888, httpd: fails to send file data...

 
 

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

bug #46888: httpd: fails to send file data prepared during http_send_headers

Submitted by:  Philipp Tölke <philipptoelke>
Submitted on:  Wed 13 Jan 2016 08:55:48 AM UTC  
 
Category: ContribSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Fri 29 Jan 2016 08:31:02 AM UTC, comment #1:

Thank you. Applied after review by Simon.

Dirk Ziegelmeier <dziegel>
Project Member
Wed 13 Jan 2016 08:55:48 AM UTC, original submission:

4023aedb3a2ad3d6ed205dbfbb34bae63a3dc48f seems to have introduced an error into the httpserver_raw:

The function http_send_headers now calls http_check_eof to "check for data to send instead of waiting for ACL". The data is prepared in hs->buf/hs->file but is not sent out in every case; to actually send data, http_send_header has to return HTTP_DATA_TO_SEND_CONTINUE.

I attached a patch that fixes the return value if data was prepared.

#v+
--- a/src/apps/httpd/httpd.c
+++ b/src/apps/httpd/httpd.c
@@ -916,7 +916,9 @@ http_send_headers(struct tcp_pcb pcb, struct http_state hs)
/* When we are at the end of the headers, check for data to send
* instead of waiting for ACK from remote side to continue
* (which would happen when sending files from async read). */
- http_check_eof(pcb, hs);
+ if(http_check_eof(pcb, hs)) {
+ data_to_send = HTTP_DATA_TO_SEND_CONTINUE;
+ }
}
/* If we get here and there are still header bytes to send, we send
* the header information we just wrote immediately. If there are no
#v-

Philipp Tölke <philipptoelke>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dziegel (Posted a comment)
  • -unavailable- added by philipptoelke (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):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 29 Jan 2016 08:31:02 AM UTCdziegelStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 13 Jan 2016 08:55:48 AM UTCphilipptoelkeAttached File-=>Added 0001-httpd-fix-sending-of-data-from-send_headers.patch, #36012

    Back to the top


    Powered by Savane 3.1-cleanup1