Applying reformime subsequent on makemime

Vladimir Dronnikov dronnikov at gmail.com
Mon Jul 6 19:42:03 UTC 2009


>>
>> In fact this is the matter of the following condition:
>>
>>       while ((line = xmalloc_fgets_str(stdin, "\r\n\r\n")) != NULL) { ...
>>
>> So we can do the following: upon the first occurance of \n to
>> determine whether or not it is prepended by \r, and then use the rule
>> to the whole content, right?
>
> I do not understand the above.
>
> Just read lines a-la fgets, strip trailing \n, *and if there is
> trailing \r, strip it too.

This can dramatically reduce the peformance. Right now reformime reads
the "super-line" (containing all the headers in a MIME section) ending
with a blank line in one go. Then performs fast scanning for critical
headers (which some server toss and even duplicate!) within allocated
memory.

That is why duplication in \r\n\r\n and failure when a blank line is
found at \n\n.

So I'm hesitating. Help me choose among speed and usability, please :)

--
Vladimir


More information about the busybox mailing list