couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject chttpd commit: updated refs/heads/master to b9ba7f9
Date Sat, 22 Aug 2015 11:11:18 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master b8437a9d1 -> b9ba7f97f


Ensure that provided bind_address is correct


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

Branch: refs/heads/master
Commit: b9ba7f97fb786ae5486145a0d6df2b9b7a3aca95
Parents: b8437a9
Author: Alexander Shorin <kxepal@apache.org>
Authored: Fri Aug 21 11:31:44 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Fri Aug 21 13:27:11 2015 +0300

----------------------------------------------------------------------
 src/chttpd.erl | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/b9ba7f97/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 8e152f6..3e8f434 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -109,7 +109,11 @@ start_link(https) ->
     start_link(https, Options).
 
 start_link(Name, Options) ->
-    IP = with_default(config:get("chttpd", "bind_address"), any),
+    IP = case config:get("chttpd", "bind_address", "any") of
+             "any" -> any;
+             Else -> Else
+         end,
+    ok = couch_httpd:validate_bind_address(IP),
 
     Options1 = Options ++ [
         {loop, fun ?MODULE:handle_request/1},
@@ -1022,9 +1026,6 @@ stack_trace_id(Stack) ->
 stack_hash(Stack) ->
     erlang:crc32(term_to_binary(Stack)).
 
-with_default(undefined, Default) -> Default;
-with_default(Value, _) -> Value.
-
 %% @doc CouchDB uses a chunked transfer-encoding to stream responses to
 %% _all_docs, _changes, _view and other similar requests. This configuration
 %% value sets the maximum size of a chunk; the system will buffer rows in the


Mime
View raw message