Jump to content

Superfluous Line Feed in HTTP GET


KeyszerS

Recommended Posts

Posted

I've been struggling with an issue where µTorrent has not been downloading files via an RSS feed, resulting in this kind of error:

I3E8y.png

I've written previously about this error at http://forum.utorrent.com/viewtopic.php?pid=658506#p658506

I've done a lot more work and research on this and found that the issue is being caused by µTorrent sending a superfluous line feed in the GET request of the .torrent file. Here's a snippet from a wireshark trace showing the superfluous line feed (highlighted)

rvktM.png

The highlighted bytes should not be there.

Referring to http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5, it states:

Request = Request-Line ; Section 5.1

*(( general-header ; Section 4.5

| request-header ; Section 5.3

| entity-header ) CRLF) ; Section 7.1

CRLF

[ message-body ] ; Section 4.3

The RFC requires one empty line (CRLF's), but µTorrent is sending two.

The HTTP Server I am using is very strict, and the extra line feed is making it choke, resulting in the server only sending the first 8 KB of the file, and then setting the TCP FIN flag, which tells µTorrent to close the connection early, hence the error shown at the top.

Edit: What's happening is that when the request buffer comes in, it parses it, and when it reaches the first blank line, it treats that as one request. It then goes to process the next part of the request, and the single blank line by itself is treating it as a "cancel previous request", resulting in the issue above.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...