185
httpd_child_spec(Config, AcceptTimeout, Debug, Addr, 0) ->
186
case start_listen(Addr, 0, Config) of
187
{Pid, {NewPort, NewConfig, ListenSocket}} ->
188
Name = {httpd_instance_sup, Addr, NewPort},
189
StartFunc = {httpd_instance_sup, start_link,
190
[NewConfig, AcceptTimeout,
191
{Pid, ListenSocket}, Debug]},
194
Modules = [httpd_instance_sup],
196
{Name, StartFunc, Restart, Shutdown, Type, Modules};
197
{Pid, {error, Reason}} ->
185
httpd_child_spec(Config, AcceptTimeout, Debug, Addr, Port) ->
186
case Port == 0 orelse proplists:is_defined(fd, Config) of
188
httpd_child_spec_listen(Config, AcceptTimeout, Debug, Addr, Port);
190
httpd_child_spec_nolisten(Config, AcceptTimeout, Debug, Addr, Port)
193
httpd_child_spec_listen(Config, AcceptTimeout, Debug, Addr, Port) ->
194
case start_listen(Addr, Port, Config) of
195
{Pid, {NewPort, NewConfig, ListenSocket}} ->
196
Name = {httpd_instance_sup, Addr, NewPort},
197
StartFunc = {httpd_instance_sup, start_link,
198
[NewConfig, AcceptTimeout,
199
{Pid, ListenSocket}, Debug]},
202
Modules = [httpd_instance_sup],
204
{Name, StartFunc, Restart, Shutdown, Type, Modules};
205
{Pid, {error, Reason}} ->
202
httpd_child_spec(Config, AcceptTimeout, Debug, Addr, Port) ->
210
httpd_child_spec_nolisten(Config, AcceptTimeout, Debug, Addr, Port) ->
203
211
Name = {httpd_instance_sup, Addr, Port},
204
212
StartFunc = {httpd_instance_sup, start_link,
205
213
[Config, AcceptTimeout, Debug]},
224
232
SocketType = proplists:get_value(socket_type, Config, ip_comm),
225
233
case http_transport:start(SocketType) of
227
case http_transport:listen(SocketType, Address, Port) of
235
Fd = proplists:get_value(fd, Config),
236
case http_transport:listen(SocketType, Address, Port, Fd) of
228
237
{ok, ListenSocket} ->
229
238
NewConfig = proplists:delete(port, Config),
230
239
{ok, NewPort} = inet:port(ListenSocket),