anchor.diff:      {partial, 1, 3} = find_in_binary(<<"foobar">>, <<"afoo">>),
       ok.
   
  +test_flash_parse() ->
  +    ContentType = "multipart/form-data; boundary=----------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5",
  +    "----------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5" = get_boundary(ContentType),
  +    BinContent = <<"------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"Filename\"\r\n\r\nhello.txt\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"success_action_status\"\r\n\r\n201\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"file\"; filename=\"hello.txt\"\r\nContent-Type: application/octet-stream\r\n\r\nhello\n\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"Upload\"\r\n\r\nSubmit Query\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5--">>,
  +    Expect = [{headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "Filename"}]}}]},
  +              {body, <<"hello.txt">>},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "success_action_status"}]}}]},
  +              {body, <<"201">>},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "file"}, {"filename", "hello.txt"}]}},
  +                {"content-type", {"application/octet-stream", []}}]},
  +              {body, <<"hello\n">>},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "Upload"}]}}]},
  +              {body, <<"Submit Query">>},
  +              body_end,
  +              eof],
  +    TestCallback = fun (Next) -> test_callback(Next, Expect) end,
  +    ServerFun = fun (Socket) ->
  +                        case gen_tcp:send(Socket, BinContent) of
  +                            ok ->
  +                                exit(normal)
  +                        end
  +                end,
  +    ClientFun = fun (Socket) ->
  +                        Req = fake_request(Socket, ContentType,
  +                                           size(BinContent)),
  +                        Res = parse_multipart_request(Req, TestCallback),
  +                        {0, <<>>, ok} = Res,
  +                        ok
  +                end,
  +    ok = with_socket_server(ServerFun, ClientFun),
  +    ok.
  +
  +test_flash_parse2() ->
  +    ContentType = "multipart/form-data; boundary=----------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5",
  +    "----------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5" = get_boundary(ContentType),
  +    Chunk = iolist_to_binary(string:copies("%", 4096)),
  +    BinContent = <<"------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"Filename\"\r\n\r\nhello.txt\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"success_action_status\"\r\n\r\n201\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"file\"; filename=\"hello.txt\"\r\nContent-Type: application/octet-stream\r\n\r\n", Chunk/binary, "\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5\r\nContent-Disposition: form-data; name=\"Upload\"\r\n\r\nSubmit Query\r\n------------ei4GI3GI3Ij5Ef1ae0KM7Ij5ei4Ij5--">>,
  +    Expect = [{headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "Filename"}]}}]},
  +              {body, <<"hello.txt">>},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "success_action_status"}]}}]},
  +              {body, <<"201">>},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "file"}, {"filename", "hello.txt"}]}},
  +                {"content-type", {"application/octet-stream", []}}]},
  +              {body, Chunk},
  +              body_end,
  +              {headers,
  +               [{"content-disposition",
  +                 {"form-data", [{"name", "Upload"}]}}]},
  +              {body, <<"Submit Query">>},
  +              body_end,
  +              eof],
  +    TestCallback = fun (Next) -> test_callback(Next, Expect) end,
  +    ServerFun = fun (Socket) ->
  +                        case gen_tcp:send(Socket, BinContent) of
  +                            ok ->
  +                                exit(normal)
  +                        end
  +                end,
  +    ClientFun = fun (Socket) ->
  +                        Req = fake_request(Socket, ContentType,
  +                                           size(BinContent)),
  +                        Res = parse_multipart_request(Req, TestCallback),
  +                        {0, <<>>, ok} = Res,
  +                        ok
  +                end,
  +    ok = with_socket_server(ServerFun, ClientFun),
  +    ok.
  +
   test() ->
       test_find_in_binary(),
       test_find_boundary(),
  
positive.code:     Chunk = read_chunk(Req, Length),
      Length1 = Length - size(Chunk),
      <<"--", Boundary:BS/binary, "\r\n", Rest/binary>> = Chunk,
      feed_mp(headers, #mp{boundary=Prefix,
                           length=Length1,
                           buffer=Rest,
                           callback=Callback,
                           req=Req}).
  
  parse_headers(<<>>) ->
      [];
  
negative.code:     feed_mp(body, State1#mp{buffer=Rest,
                              callback=NextCallback});
  feed_mp(body, State=#mp{boundary=Prefix, buffer=Buffer, callback=Callback}) ->
      Boundary = find_boundary(Prefix, Buffer),
      case Boundary of
          {end_boundary, Start, Skip} ->
              <<Data:Start/binary, _:Skip/binary, Rest/binary>> = Buffer,
              C1 = Callback({body, Data}),
  