• 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
CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery


  • Subject: CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery
  • From: "Van Tol, Ladd" <email@hidden>
  • Date: Fri, 25 Jan 2013 01:35:35 +0000
  • Thread-topic: CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery

Folks,

I'm seeing a bizarre case when using CFNetwork with kCFStreamPropertyHTTPAttemptPersistentConnection. It looks like under some circumstances, it is possible for an HTTP POST request to be sent twice, even though the code has only initiated a single request.

WireShark trace overview:

https://www.dropbox.com/s/hct0cze7hkc19xn/Screen Shot 2013-01-24 at 5.02.51 PM.png

(will send full trace file on request -- I don't want to share it with the world)

In this trace, the following notable events occur (indexed by No. column)

1. Connection is established on client port 65448
5. First HTTP post to 216.33.246.69 is sent
12. Successful response received
15. Second HTTP post is sent on same connection
16. Client immediately sends FIN, ACK to close connection
18. Client opens new connection on client port 65455
25. Client duplicates exact same request sent in 15
40. Server finishes reply to 15.
50. Server finishes reply to 25 (shorter payload, due to server error from overlapping requests).

From the client code perspective, we only see the reply to 50, and the first request is hidden from view.

Turning off kCFStreamPropertyHTTPAttemptPersistentConnection seems to avoid the issue, but I would prefer to be able to use persistent connections. This request duplication is potentially quite dangerous, so I'd like to get a handle on it.

Ladd Van Tol | Principal MTS | eBay Mobile | email@hidden | 503.265.1214 | quuxly (skype)



 _______________________________________________
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: CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: /etc/ppp/ip-[up/down] appear to be completely ignored on OS X 10.8
  • Next by Date: Re: CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery
  • Previous by thread: Re-building ppp-560.14.2 for OS-X 10.7.5
  • Next by thread: Re: CFNetwork and kCFStreamPropertyHTTPAttemptPersistentConnection request duplication mystery
  • Index(es):
    • Date
    • Thread