restsharp/RestSharp — pull request #500 by rggardner (2014-02-03 08:47:38+00:00)
Title: It appears possible for a PUT request to enter a state where a timeout d...

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