• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multiple calls to connection:didReceiveResponse: ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple calls to connection:didReceiveResponse: ?


  • Subject: Multiple calls to connection:didReceiveResponse: ?
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 25 Feb 2013 21:22:30 -0800

I’ve been using NSURLConnection since 2003, but I didn’t know it was possible for the delegate’s connection:didReceiveResponse: method to be called more than once. But sure enough, the API docs say it is:

> In rare cases, for example in the case of an HTTP load where the content type of the load data is multipart/x-mixed-replace, the delegate will receive more than one connection:didReceiveResponse: message. In the event this occurs, delegates should discard all data previously delivered by connection:didReceiveData:, and should be prepared to handle the, potentially different, MIME type reported by the newly reported URL response.

This turned out to be the cause of a weird intermittent bug* in some of my code; since I didn’t know about this situation, I wasn’t handling it correctly when it did occur. :(

I’d like to know exactly what the “rare cases” consist of. I know that there was no x-mixed-replace action going on in this case. But the developer who found the bug has some proxying and load-balancing going on in their network between the client and server. Could this double-call be a side effect of proxy logins or similar HTTP esoterica?

—Jens

* https://github.com/couchbaselabs/TouchDB-iOS/issues/236
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Multiple calls to connection:didReceiveResponse: ?
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: Socket lockup when mac put to sleep and woken up
  • Next by Date: Re: Multiple calls to connection:didReceiveResponse: ?
  • Previous by thread: Re: Socket lockup when mac put to sleep and woken up
  • Next by thread: Re: Multiple calls to connection:didReceiveResponse: ?
  • Index(es):
    • Date
    • Thread