anchor.diff:  read_more(State=#mp{length=Length, buffer=Buffer, req=Req}) ->
       Data = read_chunk(Req, Length),
       Buffer1 = <<Buffer/binary, Data/binary>>,
  -    State#mp{length=Length - size(Data),
  -             buffer=Buffer1}.
  +    flash_multipart_hack(State#mp{length=Length - size(Data),
  +                                  buffer=Buffer1}).
  +
  +flash_multipart_hack(State=#mp{length=0, buffer=Buffer, boundary=Prefix}) ->
  +    %% http://code.google.com/p/mochiweb/issues/detail?id=22
  +    %% Flash doesn't terminate multipart with \r\n properly so we fix it up here
  +    PrefixSize = size(Prefix),
  +    case size(Buffer) - (2 + PrefixSize) of
  +        Seek when Seek >= 0 ->
  +            case Buffer of
  +                <<_:Seek/binary, Prefix:PrefixSize/binary, "--">> ->
  +                    Buffer1 = <<Buffer/binary, "\r\n">>,
  +                    State#mp{buffer=Buffer1};
  +                _ ->
  +                    State
  +            end;
  +        _ ->
  +            State
  +    end;
  +flash_multipart_hack(State) ->
  +    State.
   
   feed_mp(headers, State=#mp{buffer=Buffer, callback=Callback}) ->
       {State1, P} = case find_in_binary(<<"\r\n\r\n">>, Buffer) of
  
positive.code:     {partial, 1, 3} = find_in_binary(<<"foobar">>, <<"afoo">>),
      ok.
  
  test() ->
      test_find_in_binary(),
      test_find_boundary(),
  
negative.code:             ok;
          _ ->
              fun (Next) -> test_callback(Next, Rest) end
      end;
  test_callback({body, Got}, [{body, Expect} | Rest]) ->
      GotSize = size(Got),
      <<Got:GotSize/binary, Expect1/binary>> = Expect,
      fun (Next) -> test_callback(Next, [{body, Expect1} | Rest]) end.
  
  test_parse3() ->
      ContentType = "multipart/form-data; boundary=---------------------------7386909285754635891697677882",
  