Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lingfish
Copy link
Contributor

I noticed a very strange issue with rTorrent; payloads/torrent encoded payloads bigger than 16256 bytes were failing. I put some logging around this sock.send line. Here's a working example:

2017-05-11 20:27 INFO     rtorrent      task   Sending body of len: 11344
2017-05-11 20:27 INFO     rtorrent      task   Actually sent len: 11344
2017-05-11 20:27 INFO     rtorrent      task   Sending body of len: 1026
2017-05-11 20:27 INFO     rtorrent      task   Actually sent len: 1026
2017-05-11 20:27 INFO     rtorrent      task   some.torrent.title added to rtorrent

And this is a broken example:

2017-05-11 13:20 INFO     rtorrent      task Actually sent len: 5734
2017-05-11 13:20 INFO     rtorrent      task Sending body of len: 18164
2017-05-11 13:20 INFO     rtorrent      task Actually sent len: 16256
2017-05-11 13:20 ERROR    rtorrent      task timed out

... and is then followed by an exception.

Using socket.sendall may not be the ideal solution, but it seems good enough for me.

lingfish added 2 commits May 12, 2017 17:47
I noticed a very strange issue with rTorrent; payloads/torrent encoded payloads bigger than 16256 bytes were failing.  I put some logging around this `sock.send` line.  Here's a working example:

```2017-05-11 20:27 VERBOSE  rtorrent      task   Calling load.raw()
2017-05-11 20:27 INFO     rtorrent      task   Sending body of len: 11344
2017-05-11 20:27 INFO     rtorrent      task   Actually sent len: 11344
2017-05-11 20:27 INFO     rtorrent      task   Sending body of len: 1026
2017-05-11 20:27 INFO     rtorrent      task   Actually sent len: 1026
2017-05-11 20:27 INFO     rtorrent      task   some.torrent.title added to rtorrent
```

And this is a broken example:

```2017-05-11 13:20 INFO     rtorrent      task Sending body of len: 5734
2017-05-11 13:20 INFO     rtorrent      task Actually sent len: 5734
2017-05-11 13:20 INFO     rtorrent      task Sending body of len: 18164
2017-05-11 13:20 INFO     rtorrent      task Actually sent len: 16256
2017-05-11 13:20 ERROR    rtorrent      task timed out
```

... and is then followed by an exception.

Using `socket.sendall` may not be the ideal solution, but it seems good enough for me.
Fix non-check of bytes sent over Unix socket
@cvium cvium requested a review from gazpachoking May 15, 2017 05:29
Copy link
Member

@gazpachoking gazpachoking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any special knowledge on this, but it seems pretty reasonable after reading the socket docs.
https://docs.python.org/2/library/socket.html#socket.socket.send

@cvium cvium merged commit f04a2e5 into Flexget:develop May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants