Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: question for TIdReplyPOP3.IsEndMarker procedure
| Subject: | Re: question for TIdReplyPOP3.IsEndMarker procedure |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Mon, 13 Mar 2006 19:02:07 |
"Huang Xiaobin" <hxbtougao@yahoo.com.cn> wrote in message
news:44150491$1@newsgroups.borland.com...
> i checked the source code of IsEndMarker and its inner calling procedure
> FindCodeTextDelin:
<snip>
> set input argument of IsEndMarker: AALine := 'My' (ie, less than
> 4 characters and no continuation marker),
That is not a valid POP3 response line. You must provide either '+OK' or
'-ERR' as the beginning of the line. Those are the only two values that
POP3 accepts, and TIdReplyPOP3 is designed to only recognize valid POP3
values.
> then FindCodeTextDelin(ALine) will return 3, so IsEndMarker will
> return true.
As it should be. You did not provide a valid POP3 response to begin with,
so IsEndMarker() returned True indicating that the line was the end of a
response, because it had no way to detect otherwise. Change your test code
to pass in valid POP3 responses before you try to complain about broken
behavior, because the breakage starts with your own code.
> as you can see, this is not identified with the comments.
Yes, it is:
IsEndMarker returns True when ... the fourth character is not the
continuation marker character '-' (Decimal 45).
> also i notice the following code in indy:
<snip>
> as if the IsEndMarker procedure is use to judge whether the
> response from the connection is ended or not,
As it should be, as per RFC rules.
> but in my opinion, RFC(POP3) always use '.#0D#0A' ie .CTLF to
> indicate the terminated of the response
Not true. CRLF is used to specify the end of a particular line of text, NOT
the end of a particular response. Like other text-based RFC protocols, POP3
supports responses that contain multiple lines of text. That is what the
IsEndMarker() mechanism is for - to detect when a given line of a response
indicates if there is another line in the response. Since FCmdLastResponse
is shared amongst multiple line-based protocols (FTP, SMTP, POP, IMAP4),
each protocol uses its own TIdReply descendant to handle the specific rules
of their respective RFCs.
Next time, please read the actual RFCs before you complain about the way
Indy implements them.