comparison svr-session.c @ 572:8fd0ac8c8cab

Move remotehost into svr_ses structure since we can't look it up once we've forked (the connection socket has been closed). Fixes inetd mode.
author Matt Johnston <matt@ucc.asn.au>
date Sat, 05 Sep 2009 11:40:00 +0000
parents 005530560594
children a98a2138364a
comparison
equal deleted inserted replaced
571:281ed8384eb4 572:8fd0ac8c8cab
98 len = strlen(host) + strlen(port) + 2; 98 len = strlen(host) + strlen(port) + 2;
99 svr_ses.addrstring = m_malloc(len); 99 svr_ses.addrstring = m_malloc(len);
100 snprintf(svr_ses.addrstring, len, "%s:%s", host, port); 100 snprintf(svr_ses.addrstring, len, "%s:%s", host, port);
101 m_free(host); 101 m_free(host);
102 m_free(port); 102 m_free(port);
103
104 get_socket_address(ses.sock_in, NULL, NULL,
105 &svr_ses.remotehost, NULL, 1);
103 106
104 /* set up messages etc */ 107 /* set up messages etc */
105 ses.remoteclosed = svr_remoteclosed; 108 ses.remoteclosed = svr_remoteclosed;
106 109
107 /* packet handlers */ 110 /* packet handlers */