couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject couchdb commit: updated refs/heads/1.x.x to 0c02b2c
Date Sat, 22 Aug 2015 11:27:56 GMT
Repository: couchdb
Updated Branches:
  refs/heads/1.x.x dc00bd828 -> 0c02b2c9a


Bind both to IPv4 and IPv6 with special "any" value

COUCHDB-2783


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

Branch: refs/heads/1.x.x
Commit: 0c02b2c9a961a3da1eb595e6517a01c445f54585
Parents: dc00bd8
Author: Alexander Shorin <kxepal@apache.org>
Authored: Sat Aug 22 14:27:13 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Sat Aug 22 14:27:13 2015 +0300

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0c02b2c9/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 3eb2e39..94eab7d 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -31,6 +31,7 @@
 -export([send_json/2,send_json/3,send_json/4,last_chunk/1,parse_multipart_request/3]).
 -export([accepted_encodings/1,handle_request_int/5,validate_referer/1,validate_ctype/2]).
 -export([http_1_0_keep_alive/2]).
+-export([validate_bind_address/1]).
 
 start_link() ->
     start_link(http).
@@ -88,8 +89,11 @@ start_link(Name, Options) ->
     % just stop if one of the config settings change. couch_server_sup
     % will restart us and then we will pick up the new settings.
 
-    BindAddress = couch_config:get("httpd", "bind_address", any),
-    validate_bind_address(BindAddress),
+    BindAddress = case config:get("httpd", "bind_address", "any") of
+                      "any" -> any;
+                      Else -> Else
+                  end,
+    ok = validate_bind_address(BindAddress),
     DefaultSpec = "{couch_httpd_db, handle_request}",
     DefaultFun = make_arity_1_fun(
         couch_config:get("httpd", "default_handler", DefaultSpec)
@@ -1097,6 +1101,7 @@ check_for_last(#mp{buffer=Buffer, data_fun=DataFun}=Mp) ->
                 data_fun = DataFun2})
     end.
 
+validate_bind_address(any) -> ok;
 validate_bind_address(Address) ->
     case inet_parse:address(Address) of
         {ok, _} -> ok;


Mime
View raw message