=== modified file 'src/ipc/SharedListen.cc' --- src/ipc/SharedListen.cc 2011-05-13 08:13:01 +0000 +++ src/ipc/SharedListen.cc 2011-07-19 10:46:58 +0000 @@ -127,10 +127,8 @@ void Ipc::SharedListenJoined(const SharedListenResponse &response) { - Comm::ConnectionPointer c = response.conn; - // Dont debugs c fully since only FD is filled right now. - debugs(54, 3, HERE << "got listening FD " << c->fd << " errNo=" << + debugs(54, 3, HERE << "got listening FD " << response.fd << " errNo=" << response.errNo << " mapId=" << response.mapId); Must(TheSharedListenRequestMap.find(response.mapId) != TheSharedListenRequestMap.end()); @@ -138,22 +136,24 @@ Must(por.callback != NULL); TheSharedListenRequestMap.erase(response.mapId); - if (Comm::IsConnOpen(c)) { + StartListeningCb *cbd = dynamic_cast(por.callback->getDialer()); + Must(cbd && cbd->conn != NULL); + cbd->conn->fd = response.fd; + + if (Comm::IsConnOpen(cbd->conn)) { OpenListenerParams &p = por.params; - c->local = p.addr; - c->flags = p.flags; + // XXX: these should be the same now. no need to copy. But maybe a verify check? + cbd->conn->local = p.addr; + cbd->conn->flags = p.flags; // XXX: leave the comm AI stuff to comm_import_opened()? struct addrinfo *AI = NULL; p.addr.GetAddrInfo(AI); AI->ai_socktype = p.sock_type; AI->ai_protocol = p.proto; - comm_import_opened(c, FdNote(p.fdNote), AI); + comm_import_opened(cbd->conn, FdNote(p.fdNote), AI); p.addr.FreeAddrInfo(AI); } - StartListeningCb *cbd = dynamic_cast(por.callback->getDialer()); - Must(cbd); - cbd->conn = c; cbd->errNo = response.errNo; cbd->handlerSubscription = por.params.handlerSubscription; ScheduleCallHere(por.callback);