From 6732219dc73b235dc7c69d03d2304e43c1d8b98f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 25 Jan 2013 21:27:54 +0900 Subject: [PATCH] spdyd: ListenEventHandler creation fix --- src/SpdyServer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SpdyServer.cc b/src/SpdyServer.cc index ba4f8dd5..3e34e75a 100644 --- a/src/SpdyServer.cc +++ b/src/SpdyServer.cc @@ -1007,6 +1007,9 @@ int SpdyServer::run() bool bind_ok = false; for(int i = 0; i < 2; ++i) { const char* ipv = (families[i] == AF_INET ? "IPv4" : "IPv6"); + if(sfd_[i] == -1) { + continue; + } ListenEventHandler *listen_hd = new ListenEventHandler(config_, sfd_[i], &session_id_seed); @@ -1014,6 +1017,7 @@ int SpdyServer::run() std::cerr << ipv << ": Adding listening socket to poll failed." << std::endl; delete listen_hd; + continue; } sessions.add_handler(listen_hd); bind_ok = true;