On 22 out, 02:44, onetom <[EMAIL PROTECTED]> wrote:
> Same problem here but if im correct a few weeks earlier version worked
> well...

it worked, but the method #parse_multipart hasn't changed since then.
something else is breaking it.

A quick, temporary fix for the problem (until someone find out what is
happening and fix it 'for real') :

Open file "/merb-core-0.9.10/lib/merb-core/dispatch/resquest.rb" and
find the method parse_multipart.
after the line

      if i = buf.index(rx)

add

            if i>2 and (new_i=buf.index(rx,i-2)) and (new_i<i) then
                i=new_i
           end

that's it.

Now, the explanation (well, kind of). In the line

        if i = buf.index(rx)

rx is a regular expression that starts with something like '("\r\n")?'
For some reason, the regex sometimes ignores the \r\n, matching the
pattern 2 characteres ahead from where it should match.
Now the variable 'i' is off by 2, which causes the method to parse all
the rest wrong and make all the mess that we see on the log.
the 'fix' just try to match the regex again exactly where the pattern
begins, and adjust 'i' if necessary.

I hope this help someone to really fix the bug.

(Sorry if i don't make myself very clear, i don't speak english)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to