From a4710414e0efcb456bcd725c5956547edc4162af Mon Sep 17 00:00:00 2001 From: jchu Date: Thu, 2 Sep 2004 21:15:10 +0000 Subject: added support for multiple files in the client and made the file reading less memory intensive for the server (poorly, mind you) --- tupkg/server/tupkgs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tupkg/server/tupkgs') diff --git a/tupkg/server/tupkgs b/tupkg/server/tupkgs index ef010c9..4dd085b 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): -- cgit v1.2.3-54-g00ecf