pop3: Fixed an issue with changes introduced in commit c267c53017bc
authorSteve Holme <steve_holme@hotmail.com>
Sun, 3 Jun 2012 16:06:48 +0000 (17:06 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 3 Jun 2012 16:06:48 +0000 (17:06 +0100)
commitb5bb61ee697b9a12e37c15b3bcbad33d808961d5
tree7894604ed4a75503798c06accd7d0da48e184cf0
parent69f01ec2d1f1186e28c781ae3efa65e146d8424f
pop3: Fixed an issue with changes introduced in commit c267c53017bc

Because pop3_endofresp() is called for each line of data yet is not
passed the line and line length, so we have to use the data pointed to
by pp->linestart_resp which contains the whole packet, the mechanisms
were being detected in one call yet the function would be called for
each line of data.

Using curl with verbose mode enabled would show that one line of data
would be received in response to the AUTH command, before the AUTH
<mechanism> command was sent to the server and then the next few lines
of the original AUTH command would be displayed before the response from
the AUTH <mechanism> command. This would then cause problems when
parsing the CRAM-MD5 challenge data as extra data was contained in the
buffer.

Changed the parsing so that each line is checked for the mechanisms
and the function returns FALSE until the whole of the AUTH response has
been processed.
lib/pop3.c