httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r366174 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
Date Sat, 07 Jan 2006 08:50:23 GMT
Roy T. Fielding wrote:
> On Jan 5, 2006, at 4:49 AM, maxime@apache.org wrote:
> 
>> +     In order to handle empty boundaries, we'll look for the
>> +     boundary plus the \n. */
>> +
>> +    boundary_line = apr_pstrcat(p, "--", mail->boundary, "\n", NULL);
>>
>>      /* The start boundary */
>> -    bound = ap_strstr(mail->body, mail->boundary);
>> +    bound = ap_strstr(mail->body, boundary_line);
> 
> That seems a bit risky -- MIME parts are supposed to have CRLF for
> line terminators, but that code will only search for LF on Unix.
> 
> Would it make more sense to use a regex?

Why not

+    boundary_line = apr_pstrcat(p, "--", mail->boundary, "\r\n", NULL);

which should be far faster than a regex evaluation?

Mime
View raw message