couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [16/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:49 GMT
Merge the diff for send_chunk/2


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/commit/7c335ffe
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/7c335ffe
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/7c335ffe

Branch: refs/heads/split_out_httpd_stack
Commit: 7c335ffe0268d5b20a1000a44ccacc02821d9827
Parents: 305e54b
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Thu Feb 25 11:40:02 2016 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Mar 1 08:35:07 2016 -0800

----------------------------------------------------------------------
 src/couch_httpd.erl          |  5 ++++-
 src/couch_httpd_original.erl | 12 +++---------
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/7c335ffe/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index 5db4989..3c470e2 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -528,7 +528,10 @@ send(Resp, Data) ->
 
 
 send_chunk(Resp, Data) ->
-    Resp:write_chunk(Data),
+    case iolist_size(Data) of
+        0 -> ok; % do nothing
+        _ -> Resp:write_chunk(Data)
+    end,
     {ok, Resp}.
 
 last_chunk(Resp) ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/7c335ffe/src/couch_httpd_original.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_original.erl b/src/couch_httpd_original.erl
index 58937f6..e8e6ffe 100644
--- a/src/couch_httpd_original.erl
+++ b/src/couch_httpd_original.erl
@@ -21,7 +21,7 @@
 
 -export([etag_maybe/2]).
 
--export([start_chunked_response/3,send_chunk/2]).
+-export([start_chunked_response/3]).
 -export([send_response/4,send_error/2,send_error/4, send_chunked_error/2]).
 -export([accepted_encodings/1,handle_request_int/5,validate_referer/1]).
 -export([http_1_0_keep_alive/2]).
@@ -68,7 +68,8 @@
     etag_respond/3,
     etag_match/2,
     start_reponse/3,
-    start_response_length/4
+    start_response_length/4,
+    send_chunk/2
 ]).
 
 -define(HANDLER_NAME_IN_MODULE_POS, 6).
@@ -526,13 +527,6 @@ start_chunked_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers)
->
     end,
     {ok, Resp}.
 
-send_chunk(Resp, Data) ->
-    case iolist_size(Data) of
-    0 -> ok; % do nothing
-    _ -> Resp:write_chunk(Data)
-    end,
-    {ok, Resp}.
-
 
 send_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Body) ->
     log_request(Req, Code),


Mime
View raw message