[Spambayes-checkins] spambayes/spambayes smtpproxy.py,1.9,1.10

Tony Meyer anadelonbrin at users.sourceforge.net
Wed Feb 23 02:14:59 CET 2005


Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24520/spambayes

Modified Files:
	smtpproxy.py 
Log Message:
Add [ 1144670 ] SMTP slow on large files

(Don't use string addition, use append and join).

Index: smtpproxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/smtpproxy.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** smtpproxy.py	22 Nov 2004 00:27:52 -0000	1.9
--- smtpproxy.py	23 Feb 2005 01:14:56 -0000	1.10
***************
*** 158,162 ****
          self.isClosing = False      # Has the server closed the socket?
          self.inData = False
!         self.data = ""
          self.blockData = False
  
--- 158,162 ----
          self.isClosing = False      # Has the server closed the socket?
          self.inData = False
!         self.data = []
          self.blockData = False
  
***************
*** 236,244 ****
  
          if self.inData == True:
!             self.data += self.request + '\r\n'
              if self.request == ".":
                  self.inData = False
!                 cooked = self.onProcessData(self.data)
!                 self.data = ""
                  if self.blockData == False:
                      self.serverSocket.push(cooked)
--- 236,244 ----
  
          if self.inData == True:
!             self.data.append(self.request + '\r\n')
              if self.request == ".":
                  self.inData = False
!                 cooked = self.onProcessData("".join(self.data))
!                 self.data = []
                  if self.blockData == False:
                      self.serverSocket.push(cooked)



More information about the Spambayes-checkins mailing list