[Zope-Checkins] CVS: Zope2 - FTPResponse.py:1.7 FTPServer.py:1.16

Brian Lloyd brian@digicool.com
Mon, 26 Mar 2001 22:10:22 -0500 (EST)


Update of /cvs-repository/Zope2/ZServer
In directory korak:/home/brian/temp/mainline_test/ZServer

Modified Files:
	FTPResponse.py FTPServer.py 
Log Message:
Merged fix for FTP error messages (bug # 1992)



--- Updated File FTPResponse.py in package Zope2 --
--- FTPResponse.py	2000/03/14 16:26:51	1.6
+++ FTPResponse.py	2001/03/27 03:10:21	1.7
@@ -120,6 +120,11 @@
     def _marshalledBody(self):
         return marshal.loads(self.body)
 
+    def setMessage(self, message):
+        self._message = message
+
+    def getMessage(self):
+        return getattr(self, '_message', '')
  
 class CallbackPipe:
     """

--- Updated File FTPServer.py in package Zope2 --
--- FTPServer.py	2001/02/01 16:21:12	1.15
+++ FTPServer.py	2001/03/27 03:10:21	1.16
@@ -403,13 +403,18 @@
         handle(self.module,request,response)       
            
     def stor_completion(self,response):
-        status=response.getStatus()        
+        status=response.getStatus()
+        message = response.getMessage()
+
         if status in (200,201,204,302):
-            self.client_dc.channel.respond('226 Transfer complete.')
+            self.client_dc.channel.respond('226 ' + (
+                message or 'Transfer complete.'))
         elif status==401:
-            self.client_dc.channel.respond('426 Unauthorized.')
+            self.client_dc.channel.respond('426 ' + (
+                message or 'Unauthorized.'))
         else:
-            self.client_dc.channel.respond('426 Error creating file.')       
+            self.client_dc.channel.respond('426 ' + (
+                message or 'Error creating file.'))
         self.client_dc.close()
 
     def cmd_rnfr (self, line):