summaryrefslogtreecommitdiffstats
path: root/module/network
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
parentfiles.mail.ru improvement (diff)
downloadpyload-77d436bb07eb4cf8ede5a9ec3c3bbdb4f2186602.tar.xz
small fixes: progess view in gui,xdcc,shareonline
Diffstat (limited to 'module/network')
-rw-r--r--module/network/FtpRequest.py5
-rw-r--r--module/network/XdccRequest.py14
2 files changed, 6 insertions, 13 deletions
diff --git a/module/network/FtpRequest.py b/module/network/FtpRequest.py
index fb2e6246e..d8f556fea 100644
--- a/module/network/FtpRequest.py
+++ b/module/network/FtpRequest.py
@@ -27,8 +27,7 @@ from os.path import exists
from cStringIO import StringIO
import pycurl
-class AbortDownload(Exception):
- pass
+from module.plugins.Plugin import Abort
class FtpRequest:
def __init__(self, interface=None):
@@ -161,7 +160,7 @@ class FtpRequest:
self.fp.close()
if self.abort:
- raise AbortDownload
+ raise Abort
free_name = self.get_free_name(file_name)
rename(file_temp, free_name)
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: