diff options
author | Jeix <devnull@localhost> | 2010-11-05 16:13:51 +0100 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-11-05 16:13:51 +0100 |
commit | 77d436bb07eb4cf8ede5a9ec3c3bbdb4f2186602 (patch) | |
tree | 581071381ac07229c3abd19d2cc4d90c4f043b9e /module/network/XdccRequest.py | |
parent | files.mail.ru improvement (diff) | |
download | pyload-77d436bb07eb4cf8ede5a9ec3c3bbdb4f2186602.tar.xz |
small fixes: progess view in gui,xdcc,shareonline
Diffstat (limited to 'module/network/XdccRequest.py')
-rw-r--r-- | module/network/XdccRequest.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/module/network/XdccRequest.py b/module/network/XdccRequest.py index dec71adf7..b65398dbc 100644 --- a/module/network/XdccRequest.py +++ b/module/network/XdccRequest.py @@ -23,14 +23,12 @@ import time
import socket
-from select import select
import re
from os import rename
from os.path import exists
import struct
-class AbortDownload(Exception):
- pass
+from module.plugins.Plugin import Abort
class IRCError(Exception):
def __init__(self, value):
@@ -121,7 +119,7 @@ class XdccRequest: # connect to XDCC Bot
- dcc = socket.socket()
+ dcc = socket.socket()
dcc.connect((ip, port))
dcc_packname = self.get_free_name(location + '\\' + name)
dcc_fpointer = open(dcc_packname + ".part", "wb")
@@ -132,14 +130,10 @@ class XdccRequest: if self.abort:
dcc.close()
dcc_fpointer.close()
- raise AbortDownload
-
- fdset = select([dcc], [], [], 0)
- if dcc not in fdset[0]:
- continue
+ raise Abort
# recv something
- recvbytes = dcc.recv(2**14)
+ recvbytes = dcc.recv(4096)
# connection closed and everything received -> reset variables
if len(recvbytes) == 0:
|