1

Just wanted to ask if somebody encountered a problem of using HttpWebRequest class (or even new HttpClient) when trying upload some file to the server when Fiddler is launched.

I have encountered the bug, namely, AllowWriteStreamBuffering property of HttpWebRequest class is not working when the fiddler is launched, so upload progress is not working at all. Bytes are not sent instantly but buffored even if I set AllowWriteStreamBuffering to true, therefore I can't track upload progress. It is works ok when fiddler is not launched.

Moreover if I close fiddler when my application is uploading some file, it will crash too throwing WebException which says "The underlying connection was closed: An unexpected error occurred on a receive."

The same things is happening with new .net 4.5 HttpClient class.

6
  • 2
    Fiddler acts as a proxy between your server and client. So when you access your server it goes though fiddler as a proxy server. If you close fiddler half way though this the connection will close, hence your last issue. Not sure about the AllowWriteStreamBuffering issue. I'd imagine fiddler doesn't forward this onto the server or vice versa. Commented Dec 11, 2012 at 16:52
  • My guess is that AllowWriteStreamBuffering isn't standard HTTP. It's possibly a Microsoft only implementation so Fiddler obviously doesn't do anything with it. Can you see it in the HTTP response-request you see in Fiddler? In the HTTP headers maybe? Commented Dec 11, 2012 at 16:59
  • no extra headers, AllowWriteStreamBuffering property is preventing bufforing so I can e.g. sent bytes by writing to request stream instantly, without bufforing these bytes in HttpWebBrowser cache, but fiddlers makes this property not working Commented Dec 11, 2012 at 17:02
  • I've spent such a long time trying to make upload progress tracking but it wasn't succeess untill I close a fiddler Commented Dec 11, 2012 at 17:05
  • Posted a few of the bits and pieces I found, not an expert on this tbh but maybe that'll help? Commented Dec 11, 2012 at 17:16

2 Answers 2

3

Sorry for the confusion; Fiddler currently only supports streaming of responses and not requests.

Some proxies (like Fiddler) or other intermediaries will fully buffer a request before sending it to the server for performance or functional (e.g. virus scanning, breakpoint debugging) reasons.

http://www.fiddler2.com/fiddler/help/streaming.asp

Sign up to request clarification or add additional context in comments.

2 Comments

so this is normal behaviour? and .net clasess actually thinks that they have sent bytes to server whereas these bytes was actually buforred by fiddler. Thanks
Yes, this is expected; as far as the client knows, the server got the bytes. It's just that the "server" in this case is actually the "proxy."
2

Ok, caught my interest this, it appears for AllowWriteSteamBuffering to work the server must support Chunked transfer encoding. which led me to this forum post about proxies and the afore mentioned chunked encoding: https://groups.google.com/forum/?fromgroups=#!topic/httpfiddler/UkOiK96kg_k.

It appears from what I read here that when using a proxy you may or may not get the chunked encoding, etc. hence your issue.

I also found this which seemed a good detailed article on uploading with feedback which may be helpful?

http://blogs.msdn.com/b/delay/archive/2009/09/08/when-framework-designers-outsmart-themselves-how-to-perform-streaming-http-uploads-with-net.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.