chrisidefix / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

UDP buffer size too small #616

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start downloading some torrent

What is the expected output? What do you see instead?
The torrent should download - instead the torrent switches to error mode with 
"UDP Error 123 : More data is available"

What version of the product are you using? On what operating system?
trunk r9948 (latest) on Windows 8

This patch increases the buffer size and it works again:
http://upload.beamng.com/patches/udp_bufsize.patch

Original issue reported on code.google.com by tho...@thomasfischer.biz on 9 May 2014 at 7:13

GoogleCodeExporter commented 9 years ago
I would prefer a solution that detects this error and calls set_buf_size() 
with, say, double the current buffer size.

Are you sure it's not saying "UDP Error 234 : More data is available"? That's 
ERROR_MORE_DATA.

Could you please test this patch?

http://dpaste.com/0W85QND/

Original comment by arvid.no...@gmail.com on 10 May 2014 at 3:50

GoogleCodeExporter commented 9 years ago
I've committed this to trunk in version [9950]. Please let me know if there's 
any issue with this patch.

Original comment by arvid.no...@gmail.com on 10 May 2014 at 6:38

GoogleCodeExporter commented 9 years ago
not working, the code is not functional as it is too far up.

i moved it down and also had to increase the internal ASIO values: 
http://upload.beamng.com/patches/udp_socket_fix.patch

are you sure that no packet is lost - i am not sure about the "continue" in 
there

Original comment by tho...@thomasfischer.biz on 10 May 2014 at 7:20

GoogleCodeExporter commented 9 years ago
Sorry if i wasn't clear enough. The buffer increase must come after 
"receive_from" as this spawns the error message. On my test machine it seems to 
have increased the memory 3 times via this to a final bufsize of 16384.

I am not sure if it relates to the bandwidth I am achieving with this: 8MB/s 
download

Original comment by tho...@thomasfischer.biz on 10 May 2014 at 7:26

GoogleCodeExporter commented 9 years ago
I imagine you either are transferring over loopback or have jumbo frames 
enabled on your local network.

I made some slight modifications to your patch, does this work? I removed 
setting the send buffer size. It may be necessary, but I would hope to set it 
in response to sending a packet failing. do you see any errors from send_to() 
if you don't set it?

http://dpaste.com/0JV8J5R/

Original comment by arvid.no...@gmail.com on 10 May 2014 at 9:23

GoogleCodeExporter commented 9 years ago
checked-in

Original comment by arvid.no...@gmail.com on 10 May 2014 at 11:49