summaryrefslogtreecommitdiffstats
path: root/module/network/XdccRequest.py
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-11-05 16:13:51 +0100
committerGravatar Jeix <devnull@localhost> 2010-11-05 16:13:51 +0100
commit77d436bb07eb4cf8ede5a9ec3c3bbdb4f2186602 (patch)
tree581071381ac07229c3abd19d2cc4d90c4f043b9e /module/network/XdccRequest.py
parentfiles.mail.ru improvement (diff)
downloadpyload-77d436bb07eb4cf8ede5a9ec3c3bbdb4f2186602.tar.xz
small fixes: progess view in gui,xdcc,shareonline
Diffstat (limited to 'module/network/XdccRequest.py')
-rw-r--r--module/network/XdccRequest.py14
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: