move accept to socket_accept itself
[rxpd] / src / rxpd_connection.c
index 770ef8b..a6c8355 100644 (file)
 #include "rxpd.h"
 
 struct rxpd_connection*
-rxpd_connection_new (struct rxpd_socket* socket)
+rxpd_connection_new (struct rxpd_socket* socket, int fd)
 {
   struct rxpd_connection* self;
   self = rxpd_malloc (sizeof (struct rxpd_connection));
 
-  self->fd = pth_accept (socket->fd, NULL, 0);
-  if (self->fd == -1)
-    abort ();
-
+  self->fd = fd;
   self->socket = socket;
   self->file = NULL;
   self->tmp_str = NULL;