1. Change the boundary detection to look for "#10#13--<boundary>#10#13" instead of just "--<boundary>#10#13". But this might be hard, because as far as I understood MimeDec, it already has the stream split into lines before testing for boundaries, and so it is not looking for "--<boundary>#10#13", but for "--<boundary>" in the next string, which happens to be a line; in this case, it would need to combine with #2 below.
InternalDecodeStream read the input stream and find line end (using only LF because so much messages are mal formed and use only LF instead of CR/LF pair). Of course if CR is there, it is processed transparently. Lines are processed by the magic of FNext variable which is a pointer to the next procedure to handle data pointed by FCurrentData. FNext is changed according to the state or stage of decoding. FNext point to procedures like ProcessHeaderLine, ProcessMessageLine, ProcessWaitBoundary, ... So there is a finite state machine whose state variable is FNext.
-- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be