[Checkins] SVN: zope.app.fssync/branches/jim-hack/src/zope/app/fssync/ssh.py Change ssh transport to make it reliable. Previously data could get

Amos Latteier amos at latteier.com
Fri Feb 6 14:56:01 EST 2009


Log message for revision 96197:
  Change ssh transport to make it reliable. Previously data could get 
  lost.
  

Changed:
  U   zope.app.fssync/branches/jim-hack/src/zope/app/fssync/ssh.py

-=-
Modified: zope.app.fssync/branches/jim-hack/src/zope/app/fssync/ssh.py
===================================================================
--- zope.app.fssync/branches/jim-hack/src/zope/app/fssync/ssh.py	2009-02-06 19:10:28 UTC (rev 96196)
+++ zope.app.fssync/branches/jim-hack/src/zope/app/fssync/ssh.py	2009-02-06 19:56:00 UTC (rev 96197)
@@ -117,23 +117,22 @@
         # start zsync subsystem on server
         self.channel = self.transport.open_session()
         self.channel.invoke_subsystem('zsync')
-        self.channelf = self.channel.makefile('r')
-
+        self.channelr = self.channel.makefile('rb')
+        self.channelw = self.channel.makefile('wb')
+        
         # start sending request
-        self.channel.send('%s %s\r\n' % (method, path))
+        self.channelw.write('%s %s\r\n' % (method, path))
 
     def putheader(self, name, value):
-        self.channel.send('%s: %s\r\n' % (name, value))
+        self.channelw.write('%s: %s\r\n' % (name, value))
 
     def endheaders(self):
-        self.channel.send('\r\n')
+        self.channelw.write('\r\n')
 
     def send(self, data):
-        self.channel.send(data)
+        self.channelw.write(data)
 
     def getresponse(self):
-        response = httplib.HTTPResponse(FileSocket(self.channelf))
+        response = httplib.HTTPResponse(FileSocket(self.channelr))
         response.begin()
-        self.channel.close()
-        self.transport.close()
         return response



More information about the Checkins mailing list