diff options
author | Péter Dimitrov <[email protected]> | 2018-02-20 15:24:46 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2018-02-26 09:41:21 +0100 |
commit | ae2daff04fdf7aca199e799c4f3024519e7d53f0 (patch) | |
tree | 700787407ec674ae4e3615988105e613265c9a36 /lib/inets/test/http_test_lib.erl | |
parent | b3fd7dc1b52520065e9dc977195608baf1f206ce (diff) | |
download | otp-ae2daff04fdf7aca199e799c4f3024519e7d53f0.tar.gz otp-ae2daff04fdf7aca199e799c4f3024519e7d53f0.tar.bz2 otp-ae2daff04fdf7aca199e799c4f3024519e7d53f0.zip |
inets: Add unix domain socket support to httpc
Change-Id: I44fe2670e36884e09600d17dd71b1e86b9ee75fa
Diffstat (limited to 'lib/inets/test/http_test_lib.erl')
-rw-r--r-- | lib/inets/test/http_test_lib.erl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/inets/test/http_test_lib.erl b/lib/inets/test/http_test_lib.erl index 38e9e4976e..4e119cce04 100644 --- a/lib/inets/test/http_test_lib.erl +++ b/lib/inets/test/http_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2015-2015. All Rights Reserved. +%% Copyright Ericsson AB 2015-2018. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -55,6 +55,25 @@ dummy_server_init(Caller, ip_comm, Inet, Extra) -> ]]}, [], ContentCb, Conf, ListenSocket); +dummy_server_init(Caller, unix_socket, Inet, Extra) -> + ContentCb = proplists:get_value(content_cb, Extra), + UnixSocket = proplists:get_value(unix_socket, Extra), + SocketAddr = {local, UnixSocket}, + BaseOpts = [binary, {packet, 0}, {reuseaddr,true}, {active, false}, {nodelay, true}, + {ifaddr, SocketAddr}], + Conf = proplists:get_value(conf, Extra), + {ok, ListenSocket} = gen_tcp:listen(0, [Inet | BaseOpts]), + {ok, Port} = inet:port(ListenSocket), + Caller ! {port, Port}, + dummy_ipcomm_server_loop({httpd_request, parse, [[{max_uri, ?HTTP_MAX_URI_SIZE}, + {max_header, ?HTTP_MAX_HEADER_SIZE}, + {max_version,?HTTP_MAX_VERSION_STRING}, + {max_method, ?HTTP_MAX_METHOD_STRING}, + {max_content_length, ?HTTP_MAX_CONTENT_LENGTH}, + {customize, httpd_custom} + ]]}, + [], ContentCb, Conf, ListenSocket); + dummy_server_init(Caller, ssl, Inet, Extra) -> ContentCb = proplists:get_value(content_cb, Extra), SSLOptions = proplists:get_value(ssl, Extra), |