reenable SHUTDOWN
authorChristian Thaeter <ct@pipapo.org>
Mon, 22 Oct 2007 11:20:10 +0000 (13:20 +0200)
committerChristian Thaeter <ct@pipapo.org>
Mon, 22 Oct 2007 11:20:10 +0000 (13:20 +0200)
src/rxpd.h
src/rxpd_connection_cmd.c
src/rxpd_socket.c

index ade5d6a..7954225 100644 (file)
@@ -201,6 +201,9 @@ rxpd_socket_spawn (struct rxpd_socket* self);
 struct rxpd_socket*
 rxpd_socket_join (struct rxpd_socket* self);
 
+struct rxpd_socket*
+rxpd_socket_cancel (struct rxpd_socket* self);
+
 //
 
 enum rxpd_buffer_state_e
index 06e969a..caebb9e 100644 (file)
@@ -333,17 +333,13 @@ rxpd_connection_cmd_LIST (struct rxpd_connection* self)
 void
 rxpd_connection_cmd_SHUTDOWN (struct rxpd_connection* self)
 {
-  (void) self;
-  //struct rxpd_base* base = self->socket->base;
-  // destroy all sockets
-#if 0
-  LLIST_WHILE_HEAD (&base->sockets, n)
+  struct rxpd_base* base = self->socket->base;
+  LLIST_FOREACH (&base->sockets, n)
     {
       struct rxpd_socket* socket = (struct rxpd_socket*)n;
-      rxpd_socket_delete (socket);
+      rxpd_socket_cancel (socket);
     }
   rxpd_buffer_printf (&self->out, "#OK:\n");
-#endif
 }
 
 
index 9c7dd0d..8c34c5d 100644 (file)
@@ -122,6 +122,13 @@ rxpd_socket_spawn (struct rxpd_socket* self)
   return self;
 }
 
+struct rxpd_socket*
+rxpd_socket_cancel (struct rxpd_socket* self)
+{
+  pth_cancel (self->accepter);
+  return self;
+}
+
 void *
 rxpd_socket_accept (void* ptr)
 {