You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/07/27 14:12:54 UTC

[1/2] chttpd commit: updated refs/heads/master to 77b3af4

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 3866725ee -> 77b3af447


Revert "Discard request body after request"

This reverts commit 56cf6412ad3572b5d07a281c5a25ec511af0530c.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/9dc2ba52
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/9dc2ba52
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/9dc2ba52

Branch: refs/heads/master
Commit: 9dc2ba523dc0edb54a991c4199bb1f2d0ed2c695
Parents: 3866725
Author: Robert Newson <rn...@apache.org>
Authored: Mon Jul 27 12:32:35 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Jul 27 12:32:35 2015 +0100

----------------------------------------------------------------------
 src/chttpd.erl | 51 ---------------------------------------------------
 1 file changed, 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/9dc2ba52/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 9fb9395..1e80a53 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -251,8 +251,6 @@ handle_request(MochiReq0) ->
                 _Else ->
                     send_error(HttpReq, {Error, nil, Stack})
             end
-    after
-        maybe_discard_body(HttpReq)
     end,
 
     RequestTime = timer:now_diff(os:timestamp(), Begin)/1000,
@@ -504,55 +502,6 @@ json_body_obj(Httpd) ->
     end.
 
 
-maybe_discard_body(#httpd{mochi_req=MochiReq}=Req) ->
-    case erlang:get(mochiweb_request_body) of
-        undefined ->
-            Expect = case MochiReq:get_header_value("expect") of
-                undefined ->
-                    undefined;
-                Value when is_list(Value) ->
-                    string:to_lower(Value)
-                end,
-            case Expect of
-                "100-continue" ->
-                    ok;
-                _Else  ->
-                    discard_body(Req)
-            end;
-        _Body ->
-            ok % already consumed.
-    end.
-
-
-discard_body(#httpd{}=Req) ->
-    case body_length(Req) of
-        undefined ->
-            ok;
-        {unknown_transfer_encoding, Unknown} ->
-            exit({unknown_transfer_encoding, Unknown});
-        chunked ->
-            discard(Req);
-        0 ->
-            ok;
-        Length when is_integer(Length) ->
-            discard(Req);
-        Length ->
-            exit({length_not_integer, Length})
-    end.
-
-discard(#httpd{mochi_req=MochiReq}) ->
-    Discarded = MochiReq:stream_body(8192,
-        fun ({Len, _}, Acc) -> Len + Acc end, 0),
-    case Discarded of
-        undefined ->
-            ok;
-        Length when is_integer(Length) ->
-            couch_log:notice("Discarded ~B bytes of request body.",
-                     [Discarded])
-    end,
-    ok.
-
-
 doc_etag(#doc{revs={Start, [DiskRev|_]}}) ->
     "\"" ++ ?b2l(couch_doc:rev_to_str({Start, DiskRev})) ++ "\"".
 


[2/2] chttpd commit: updated refs/heads/master to 77b3af4

Posted by rn...@apache.org.
Handle waiting_for_updates in callback

COUCHDB-2724


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/77b3af44
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/77b3af44
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/77b3af44

Branch: refs/heads/master
Commit: 77b3af44739889b6f2ec69520943e9e52f20c0d0
Parents: 9dc2ba5
Author: Robert Newson <rn...@apache.org>
Authored: Mon Jul 27 13:11:29 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Jul 27 13:11:29 2015 +0100

----------------------------------------------------------------------
 src/chttpd_auth_cache.erl | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/77b3af44/src/chttpd_auth_cache.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_auth_cache.erl b/src/chttpd_auth_cache.erl
index 8caa112..61ee472 100644
--- a/src/chttpd_auth_cache.erl
+++ b/src/chttpd_auth_cache.erl
@@ -135,6 +135,8 @@ listen_for_changes(Since) ->
     },
     fabric:changes(dbname(), CBFun, Since, Args).
 
+changes_callback(waiting_for_updates, Acc) ->
+    {ok, Acc};
 changes_callback(start, Since) ->
     {ok, Since};
 changes_callback({stop, EndSeq, _Pending}, _) ->