It appears possible for a PUT request to enter a state where a timeout d... #500

Merged
merged 3 commits into from Feb 3, 2014

Conversation

Projects
None yet
2 participants
Contributor

rggardner commented Feb 3, 2014

...oes not correctly fire. The asyncresult of the request is correctly passed into the SetTimeout method after creation but when it progresses to the response object the SetTimeout is neglected.

This has previously been discussed on the google groups

https://groups.google.com/forum/#!topic/restsharp/SMl7sBN72xE

This allows for a scenario where a put request can begin and if an error occurs in the response the client can remain unaware as the timeout is not called and therefore the callback never completes. I have seen this behaviour on a mobile device where the connection is dropped during a PUT request that takes a few seconds to return.

I have included two tests. One displaying the correct timeout behaviour for a GET request and one displaying the incorrect behaviour of a PUT (with content). Adding the additional SetTimeout to the async call appears to produce the same timeout behaviour n both calls.

Ross Gardner and others added some commits Jan 31, 2014

Ross Gardner It appears possible for a PUT request to enter a state where a timeou…
…t does not correctly fire. The asyncresult of the request is correctly passed into the SetTimeout method after creation but when it progresses to the response object the SetTimeout is neglected.

This allows for a scenario where a put request can begin and if an error occurs in the response the client can remain unaware as the timeout is not called and therefore the callback never completes.  I have seen this behaviour on a mobile device where the connection is dropped during a PUT request that takes a few seconds to return.
3e6b4e5
@rggardner rggardner Update AsyncTests.cs
Fixed indentation
f519cec
@rggardner rggardner Update Http.Async.cs
Fixed indentation
721d9dc

@Haacked Haacked added a commit that referenced this pull request Feb 3, 2014

@Haacked Haacked Merge pull request #500 from rggardner/timeout-put-async
It appears possible for a PUT request to enter a state where a timeout d...
821153d

@Haacked Haacked merged commit 821153d into restsharp:master Feb 3, 2014

Contributor

Haacked commented Feb 3, 2014

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment