bugGNUstep - Bugs: bug #38043, Incorrect nil return value from...

Group
 
 

bug #38043: Incorrect nil return value from NSURLConnection +sendSynchronousRequest:returningResponse:error:

Submitter:  Wolfgang Lux <wlux>
Submitted:  Tue 08 Jan 2013 09:34:52 AM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 21 Jan 2013 10:58:45 AM UTC, comment #1: 

Thanks ... that should be OK in svn now.
I changed the downloder to create an empty data item on startup, and destroy it in error, so the return value should now be an empty item if no error occurs but no body is found.

Richard Frith-Macdonald <CaS>
Group Member
Tue 08 Jan 2013 09:34:52 AM UTC, original submission:  

According to Apple's documentation this method "Returns nil if a connection could not be created or if the download fails." The GNUstep implementation, however, also returns nil from this method when the body of the web server response is empty. It should return an empty NSData object instead.
Test case is attached. The attached, simple web server responds 204 No Content to every GET request. When compiled with GNUstep the test program prints
127.0.0.1 - - [2013-01-08 10:31:38 +0100] "GET / HTTP/1.1" - "HTTP/1.1 204 No Content"
2013-01-08 10:31:38.719 test[89837] data = (null)
When compiled with Cocoa, the test program prints:
127.0.0.1 - - [2013-01-08 10:32:55 +0100] "GET / HTTP/1.1" "test-Cocoa (unknown version) CFNetwork/454.12.4 Darwin/10.8.0 (i386) (iMac5%2C1)" "HTTP/1.1 204 No Content"
2013-01-08 10:32:55.592 test-Cocoa[89858:903] data = <>

Wolfgang Lux <wlux>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27220:  WebServer.m added by wlux (1KiB - application/octet-stream)
file #27221:  test.m added by wlux (412B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by wlux (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.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-21 CaS StatusNone Fixed
        Open/ClosedOpen In Test
    2013-01-08 wlux Attached File- Added WebServer.m, #27220
        Attached File- Added test.m, #27221

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code