Opened 16 years ago

Closed 15 years ago

#1691 defect closed fixed (fixed)

POP3Client can't deal with the continued commands request

Reported by: tomoyuki Owned by:
Priority: normal Milestone:
Component: mail Keywords:
Cc: spiv, tomoyuki, therve Branch:
Author:

Description

*** pop3client.py.orig  2005-09-11 13:15:03.000000000 +0900
--- pop3client.py       2006-05-02 13:10:06.000000000 +0900
***************
*** 191,200 ****
          # is expected.  Return a Deferred that fires when the response
          # is received.  Block all further commands from being sent until
          # the response is received.  Transition the state to SHORT.
!         d = self._blocked(self.sendShort, cmd, args)
          if d is not None:
              return d

          if args:
              self.sendLine(cmd + ' ' + args)
          else:
--- 191,202 ----
          # is expected.  Return a Deferred that fires when the response
          # is received.  Block all further commands from being sent until
          # the response is received.  Transition the state to SHORT.
!         d = self._blocked(self._sendShort, cmd, args)
          if d is not None:
              return d
+         return self._sendShort(cmd, args):

+     def _sendShort(self, cmd, args):
          if args:
              self.sendLine(cmd + ' ' + args)
          else:
***************
*** 212,218 ****
--- 214,222 ----
          d = self._blocked(self.sendLong, cmd, args, consumer, xform)
          if d is not None:
              return d
+         return self._sendLong(cmd, args, consumer, xform):

+     def _sendLong(self, cmd, args, consumer, xform):
          if args:
              self.sendLine(cmd + ' ' + args)
          else:

Change History (8)

comment:1 Changed 16 years ago by tomoyuki

*** pop3client.py.orig  2005-09-11 13:15:03.000000000 +0900
--- pop3client.py       2006-05-02 13:23:45.000000000 +0900
***************
*** 191,200 ****
          # is expected.  Return a Deferred that fires when the response
          # is received.  Block all further commands from being sent until
          # the response is received.  Transition the state to SHORT.
!         d = self._blocked(self.sendShort, cmd, args)
          if d is not None:
              return d

          if args:
              self.sendLine(cmd + ' ' + args)
          else:
--- 191,202 ----
          # is expected.  Return a Deferred that fires when the response
          # is received.  Block all further commands from being sent until
          # the response is received.  Transition the state to SHORT.
!         d = self._blocked(self._sendShort, cmd, args)
          if d is not None:
              return d
+         return self._sendShort(cmd, args)

+     def _sendShort(self, cmd, args):
          if args:
              self.sendLine(cmd + ' ' + args)
          else:
***************
*** 209,218 ****
          # the entire response is received.  Block all further commands
          # from being sent until the entire response is received.
          # Transition the state to LONG_INITIAL.
!         d = self._blocked(self.sendLong, cmd, args, consumer, xform)
          if d is not None:
              return d

          if args:
              self.sendLine(cmd + ' ' + args)
          else:
--- 211,222 ----
          # the entire response is received.  Block all further commands
          # from being sent until the entire response is received.
          # Transition the state to LONG_INITIAL.
!         d = self._blocked(self._sendLong, cmd, args, consumer, xform)
          if d is not None:
              return d
+         return self._sendLong(cmd, args, consumer, xform)

+     def _sendLong(self, cmd, args, consumer, xform):
          if args:
              self.sendLine(cmd + ' ' + args)
          else:

comment:2 Changed 16 years ago by spiv

Keywords: block defer DeferredList removed

Please use unified diff (diff -u) format for patches, as requested by http://twistedmatrix.com/trac/wiki/TwistedDevelopment. They're generally shorter and much more readable.

Also, please provide test cases for your fixes. As you've already noticed, your initial patch had an obvious SyntaxError that shows you didn't even trivially test it before submitting it to us. By adding tests to the test suite in your patch, you can be sure that:

  • you haven't broken something else,
  • any last minute tweaks don't include embarrassing bugs like syntax errors,
  • we understand what problem you're fixing,
  • we can reproduce your problem (by running your tests without your fix, and watching them fail), and see that your fix works (by running your tests with your fix, and watching them pass),
  • and last, but not least, ensure that this problem stays fixed, by making it hard for future work by other people to accidentally break it.

At the very least, try to describe a way that a developer can reproduce your issue, so that we try to construct a test case for it ourselves if you can't.

Thanks!

comment:3 Changed 16 years ago by spiv

Cc: spiv added

comment:4 Changed 16 years ago by Jean-Paul Calderone

Can anyone clue me in? What is a "continued command request"?

comment:5 Changed 16 years ago by Jean-Paul Calderone

Cc: tomoyuki added

comment:6 Changed 16 years ago by therve

Cc: therve added

It seems to me that the patch does absolutely nothing (as it's not a unified diff, it's hard to tell). And I don't know what is a continued command request either.

May we close it to wake up the poster ?

comment:7 Changed 15 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [17820]) Merge pop3-concurrent-retrieve-1988

Author: exarkun Reviewer: radix Fixes #1988 Fixes #1691

This fixes the POP3 client to correctly unblock itself after a command completes successfully and there is more than one other command pending.

comment:8 Changed 11 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.