Re: [PATCH] sloppy mime parsing patch

Aarno Syvänen <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
On Tuesday, April 8, 2003, at 10:55 AM, Stipe Tolj wrote:

> Aarno Syvänen wrote:
>>
>> Hi List,
>>
>> This is patching changing Kannel mime parsing so that it
>> accepts lf instead of crlf as a separator, but only if this is
>> configured (strict-parsing=no).
>>
>> I send the patch, because Paul vetoed the first one. Now
>> he can check does this one work properly.
>>
>> Patch has three parts:
>>
>> a) Kannel read configuration directive strict-parsing and
>>      parses mime multipart accordingly.
>> b) test_ppg accepts binary content  and sends mime
>>      content with different separators (crlf or lf).
>> c) There are two new octstr functions.
>
> Aarno the code delivers the "strictness" via several levels of
> function calls. Wouldn't it have been a lot of easier to pro-claim
> this as global variable (like ie. my smart-error message variable) and
> simply access it whereever the if condition is really needed?
>
> I think this would reduce the code changes drastically.
>
> Intention is that function parameters sould be semantically bind to
> the logic inside the function. If parameters are passed within several
> level, there is no semantical use of it within the "internal"
> functions and hence the only thing you do is to trasport a global
> scoped variable from a very high'ed to low'ed function call level.
>
> I hope this was not writen in too wired ways ;)

Another point of coding style. I wanted mime_parse have input
variable telling is parsing sloppy or strict. I think this kind of thing
should be *very* transparent, there are actually two different parsing
functions here.

Aarno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.