[Bese-devel] Re: rfc2388

Lou Vanek vanek at acd.net
Mon Jul 17 15:16:44 UTC 2006


Marco Baringer wrote:

> Lou Vanek <vanek at acd.net> writes:
> 
>>if anybody out there is using clisp and needs an rfc2388 mime parser,
>>the attached code will probably save you some time.
> 
> 
> does the current parser fail on clisp?

On the mime headers i get when running the upload file example,
clisp cannot parse 'em, at least on windows. Two reasons below.
Third reason: the stream i get from araneida (nonbuffered-character)
is not readable via "read-byte", which is why i added the stream-reader
function. But i still had problems with the parser, as detailed below.

> 
>>character stream entry point: parse-mime-c
>>binary    stream entry point: parse-mime-b
>>
>>parse-mime-b is pretty much just a carbon copy of what's already in
>>rfc2388; and parse-mime-c has a more robust parser to take care of
>>clisp's end-of-line read quirks on windows systems.
>>This code should work with all CLs since there is no clisp-specific code.
>>There are two minor additional features:
>>- parse-mime-c can parse dirtier mime headers
> 
> 
> what's the definition of 'dirtier'?

The binary parser cannot handle pure-unix line endings,
and i believe the binary parser requires two dashes surrounding
the boundary string.

clisp coalesces <cr><nl> into just <nl> on windows unless
you are able to drop down into reading the stream in binary,
which i wasn't able to do. I don't think that's possible in clisp
for some types of streams.

i think the binary parser expects the boundary to be
both prefixed and suffixed with two dashes, but the
mime boundary that i received didn't end with two dashes,
and rfc2046 doesn't require it.

i also don't think the binary parser currently is set
up to restrict the size of the upload.

hth



More information about the bese-devel mailing list