summaryrefslogtreecommitdiffstats
path: root/tupkg/server/tupkgs
diff options
context:
space:
mode:
authorjchu <jchu>2004-09-02 23:15:10 +0200
committerjchu <jchu>2004-09-02 23:15:10 +0200
commita4710414e0efcb456bcd725c5956547edc4162af (patch)
tree6e98a997a6e538bb523ec29921bd71212f39d968 /tupkg/server/tupkgs
parent2423a686d6c26747c36b672e1132860302ed826b (diff)
downloadaur-a4710414e0efcb456bcd725c5956547edc4162af.tar.gz
aur-a4710414e0efcb456bcd725c5956547edc4162af.tar.xz
added support for multiple files in the client and made the file reading less memory intensive for the server (poorly, mind you)
Diffstat (limited to 'tupkg/server/tupkgs')
-rwxr-xr-xtupkg/server/tupkgs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tupkg/server/tupkgs b/tupkg/server/tupkgs
index ef010c94..4dd085b6 100755
--- a/tupkg/server/tupkgs
+++ b/tupkg/server/tupkgs
@@ -108,7 +108,14 @@ class ClientSocket(threading.Thread):
def readFiles(self):
for i in self.files:
- i.fd.write(self.reliableRead(i.actual_size))
+ count = 0
+ while count != i.actual_size:
+ if count + 1024 > i.actual_size:
+ i.fd.write(self.reliableRead(i.actual_size - count))
+ count += i.actual_size - count
+ else:
+ i.fd.write(self.reliableRead(1024))
+ count += 1024
i.fd.flush()
reply = {'numpkgs': len(self.files)}
for i, v in enumerate(self.files):