couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [04/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:37 GMT
Convert case into clause for body/1 as in original


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/8c5a833e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/8c5a833e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/8c5a833e

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

----------------------------------------------------------------------
 src/couch_httpd.erl | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/8c5a833e/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index c268f8c..83c39cc 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -345,22 +345,20 @@ recv_chunked(#httpd{mochi_req=MochiReq}, MaxChunkSize, ChunkFun, InitState)
->
 body_length(#httpd{mochi_req=MochiReq}) ->
     MochiReq:get(body_length).
 
-body(#httpd{mochi_req=MochiReq, req_body=ReqBody}) ->
-    case ReqBody of
-        undefined ->
-            % Maximum size of document PUT request body (4GB)
-            MaxSize = list_to_integer(
-                config:get("couchdb", "max_document_size", "4294967296")),
-            Begin = os:timestamp(),
-            try
-                MochiReq:recv_body(MaxSize)
-            after
-                T = timer:now_diff(os:timestamp(), Begin) div 1000,
-                put(body_time, T)
-            end;
-        _Else ->
-            ReqBody
-    end.
+body(#httpd{mochi_req=MochiReq, req_body=undefined}) ->
+    % Maximum size of document PUT request body (4GB)
+    MaxSize = list_to_integer(
+        config:get("couchdb", "max_document_size", "4294967296")),
+    Begin = os:timestamp(),
+    try
+        MochiReq:recv_body(MaxSize)
+    after
+        T = timer:now_diff(os:timestamp(), Begin) div 1000,
+        put(body_time, T)
+    end;
+body(#httpd{req_body=ReqBody}) ->
+    ReqBody.
+
 
 json_body(Httpd) ->
     case body(Httpd) of


Mime
View raw message