0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Add multipart support

This commit is contained in:
Anthony Ramine 2011-11-08 00:51:49 +01:00 committed by Loïc Hoguin
parent a5b47fda8d
commit 528507c7de
7 changed files with 382 additions and 6 deletions

View file

@ -37,6 +37,13 @@
-type http_cookies() :: list({binary(), binary()}).
-type http_status() :: non_neg_integer() | binary().
%% @todo Improve this type.
-type multipart_data() ::
{headers, http_headers()} |
{data, binary()} |
end_of_part |
eof.
-record(http_req, {
%% Transport.
socket = undefined :: undefined | inet:socket(),
@ -62,7 +69,8 @@
cookies = undefined :: undefined | http_cookies(),
%% Request body.
body_state = waiting :: waiting | done,
body_state = waiting :: waiting | done |
{multipart, non_neg_integer(), fun()},
buffer = <<>> :: binary(),
%% Response.