minor cosmetic changes/renames
authorChristian Thaeter <ct@pipapo.org>
Fri, 5 Oct 2007 09:35:01 +0000 (11:35 +0200)
committerChristian Thaeter <ct@pipapo.org>
Fri, 5 Oct 2007 09:35:01 +0000 (11:35 +0200)
rxpd.c
rxpd.h

diff --git a/rxpd.c b/rxpd.c
index 7bcea15..22b1e85 100644 (file)
--- a/rxpd.c
+++ b/rxpd.c
@@ -264,7 +264,7 @@ rxpd_socket_activate (struct rxpd_socket* self)
 {
   if (self)
     {
-      llist_insert_tail (&self->base->sockets_active, &self->node);
+      llist_insert_head (&self->base->sockets_active, &self->node);
       event_add (&self->ev, NULL);
     }
   return self;
@@ -286,12 +286,13 @@ rxpd_socket_accept (int fd, short event, void* ptr)
 {
   printf ("incoming connection\n");
 
-  struct rxpd_socket* sock = ptr;
+  struct rxpd_socket* self = ptr;
 
   struct rxpd_connection* conn =
-    rxpd_connection_new (sock->base, fd);
+    rxpd_connection_new (self->base, fd);
 
   rxpd_connection_activate (conn);
+  rxpd_socket_activate (self);
 }
 
 ///
@@ -411,7 +412,6 @@ rxpd_connection_new (struct rxpd_base* base, int fd)
   if (setsockopt (self->fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1)
     abort ();
 
-
   self->base = base;
   self->file = NULL;
 
diff --git a/rxpd.h b/rxpd.h
index e60e8e0..ed45055 100644 (file)
--- a/rxpd.h
+++ b/rxpd.h
   RXPD_CMD(LOAD)                                \
   RXPD_CMD(SAVE)                                \
   RXPD_CMD(DUMP)                                \
-  RXPD_CMD(LIST)                                \
-  RXPD_CMD(END)                                 \
+  RXPD_CMD(LIST)
 
 #define RXPD_CMD(cmd) RXPD_CMD_##cmd,
-enum {RXPD_COMMANDS};
+enum rxpd_cmd_e {RXPD_COMMANDS};
 #undef RXPD_CMD
 
 struct rxpd_base;
@@ -211,10 +210,10 @@ int
 rxpd_connection_readline (struct rxpd_connection* self);
 
 void
-rxpd_connection_parse_cmd (int sock, short event, void* ptr);
+rxpd_connection_parse_cmd (int fd, short event, void* ptr);
 
 /* generate prototypes for each defined command */
-#define RXPD_CMD(cmd) void rxpd_connection_cmd_##cmd (int sock, short event, void* ptr);
+#define RXPD_CMD(cmd) void rxpd_connection_cmd_##cmd (int fd, short event, void* ptr);
 RXPD_COMMANDS
 #undef RXPD_CMD