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

 
 

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

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

Submitted by:  Wolfgang Lux <wlux>
Submitted on:  Tue 08 Jan 2013 09:34:52 AM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: In Test

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>
Project 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>

 

Attached Files
file #27220:  WebServer.m added by wlux (1kB - 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
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by wlux (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 21 Jan 2013 10:58:45 AM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Tue 08 Jan 2013 09:34:52 AM UTCwluxAttached File-=>Added WebServer.m, #27220
      Attached File-=>Added test.m, #27221

    Back to the top


    Powered by Savane 3.1-cleanup