From 937a2b03260a86b915a128fbbdf3b88a8a76cc3f Mon Sep 17 00:00:00 2001 From: Magnus Klaar Date: Wed, 28 Dec 2011 18:00:27 +0100 Subject: Add cowboy_http_req:set_resp_body_fun/3. --- include/http.hrl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/http.hrl b/include/http.hrl index 84b9489..c47a244 100644 --- a/include/http.hrl +++ b/include/http.hrl @@ -36,6 +36,8 @@ -type http_headers() :: list({http_header(), iodata()}). -type http_cookies() :: list({binary(), binary()}). -type http_status() :: non_neg_integer() | binary(). +-type http_resp_body() :: iodata() | {non_neg_integer(), + fun(() -> {sent, non_neg_integer()})}. -record(http_req, { %% Transport. @@ -69,7 +71,7 @@ %% Response. resp_state = waiting :: locked | waiting | chunks | done, resp_headers = [] :: http_headers(), - resp_body = <<>> :: iodata(), + resp_body = <<>> :: http_resp_body(), %% Functions. urldecode :: {fun((binary(), T) -> binary()), T} -- cgit v1.2.3