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/29 20:29:38 UTC

chttpd commit: updated refs/heads/master to 89ca7e0

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master f9cad9dd1 -> 89ca7e034


Fix vhost rewrite loop but


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

Branch: refs/heads/master
Commit: 89ca7e034d7ad60a859592aa1b905fcde83702cc
Parents: f9cad9d
Author: Ólafur Arason <ol...@olafura.com>
Authored: Wed Jul 29 18:24:56 2015 +0000
Committer: Ólafur Arason <ol...@olafura.com>
Committed: Wed Jul 29 18:24:56 2015 +0000

----------------------------------------------------------------------
 src/chttpd.erl         | 6 ++++--
 src/chttpd_rewrite.erl | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/89ca7e03/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 31c16d3..8f5a5bd 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -14,7 +14,7 @@
 -include_lib("couch/include/couch_db.hrl").
 
 -export([start_link/0, start_link/1, start_link/2,
-    stop/0, handle_request/1,
+    stop/0, handle_request/1, handle_request_int/1,
     primary_header_value/2, header_value/2, header_value/3, qs_value/2,
     qs_value/3, qs/1, qs_json_value/3, path/1, absolute_uri/2, body_length/1,
     verify_is_server_admin/1, unquote/1, quote/1, recv/2, recv_chunked/4,
@@ -129,10 +129,12 @@ stop() ->
     mochiweb_http:stop(?MODULE).
 
 handle_request(MochiReq0) ->
-    Begin = os:timestamp(),
     erlang:put(?REWRITE_COUNT, 0),
     MochiReq = couch_httpd_vhost:dispatch_host(MochiReq0),
+    handle_request_int(MochiReq).
 
+handle_request_int(MochiReq) ->
+    Begin = os:timestamp(),
     case config:get("chttpd", "socket_options") of
     undefined ->
         ok;

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/89ca7e03/src/chttpd_rewrite.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_rewrite.erl b/src/chttpd_rewrite.erl
index 87198d4..a1718d4 100644
--- a/src/chttpd_rewrite.erl
+++ b/src/chttpd_rewrite.erl
@@ -186,7 +186,7 @@ handle_rewrite_req(#httpd{
             % cleanup, It force mochiweb to reparse raw uri.
             MochiReq1:cleanup(),
 
-            chttpd:handle_request(MochiReq1)
+            chttpd:handle_request_int(MochiReq1)
         end.
 
 quote_plus({bind, X}) ->