aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2011-11-08 00:51:49 +0100
committerLoïc Hoguin <[email protected]>2012-01-23 07:20:35 +0100
commit528507c7decb2bf2fcbb55a47256011c2ce4bd4b (patch)
tree14966540ecf17499d1d3e161c5690f5de4fbbf0d /include
parenta5b47fda8de7972c9affb4f4d1320fb666c67a92 (diff)
downloadcowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.tar.gz
cowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.tar.bz2
cowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.zip
Add multipart support
Diffstat (limited to 'include')
-rw-r--r--include/http.hrl10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/http.hrl b/include/http.hrl
index 7691966..3b4e938 100644
--- a/include/http.hrl
+++ b/include/http.hrl
@@ -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.