0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-20 08:51:18 +01:00

add_connection fixed to accept F instead of fd

This commit is contained in:
Valery Yatsko 2008-04-02 20:45:37 +04:00
parent 8e09c4a231
commit 99c4835f99

View file

@ -360,12 +360,12 @@ add_listener(int port, const char *vhost_ip, int family)
switch(family) switch(family)
{ {
case AF_INET: case AF_INET:
SET_SS_LEN(vaddr, sizeof(struct sockaddr_in)); SET_SS_LEN(&vaddr, sizeof(struct sockaddr_in));
((struct sockaddr_in *)&vaddr)->sin_port = htons(port); ((struct sockaddr_in *)&vaddr)->sin_port = htons(port);
break; break;
#ifdef IPV6 #ifdef IPV6
case AF_INET6: case AF_INET6:
SET_SS_LEN(vaddr, sizeof(struct sockaddr_in6)); SET_SS_LEN(&vaddr, sizeof(struct sockaddr_in6));
((struct sockaddr_in6 *)&vaddr)->sin6_port = htons(port); ((struct sockaddr_in6 *)&vaddr)->sin6_port = htons(port);
break; break;
#endif #endif
@ -442,7 +442,7 @@ close_listeners()
* any client list yet. * any client list yet.
*/ */
static void static void
add_connection(listener_t *listener, int fd, struct sockaddr *sai, int exempt) add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, int exempt)
{ {
struct Client *new_client; struct Client *new_client;
s_assert(NULL != listener); s_assert(NULL != listener);
@ -465,7 +465,7 @@ add_connection(listener_t *listener, int fd, struct sockaddr *sai, int exempt)
strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host)); strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host));
new_client->localClient->F = rb_add_fd(fd); new_client->localClient->F = F;
new_client->localClient->listener = listener; new_client->localClient->listener = listener;
++listener->ref_count; ++listener->ref_count;