[Zope-Checkins] CVS: Zope2 - FTPResponse.py:1.6.112.1 FTPServer.py:1.13.8.3

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


Update of /cvs-repository/Zope2/ZServer
In directory korak:/home/brian/temp/zope-23-branch/ZServer

Modified Files:
      Tag: zope-2_3-branch
	FTPResponse.py FTPServer.py 
Log Message:
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:09:48	1.6.112.1
@@ -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:20:30	1.13.8.2
+++ FTPServer.py	2001/03/27 03:09:48	1.13.8.3
@@ -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):