]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Some small fixes and added FIXME comments
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 19 Jun 2008 08:31:49 +0000 (10:31 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 19 Jun 2008 08:31:49 +0000 (10:31 +0200)
fwp/lib/core/fwp_endpoint.c
fwp/mngr/fwp_mngr.c

index e84fe1b17b728155847ee71f74222ef4cfd9134e..38eaf7bd7158181d2391fe4777423cd6850ff4cd 100644 (file)
@@ -378,8 +378,8 @@ ssize_t fwp_recv(fwp_endpoint_d_t epointd, void *buffer, size_t buffer_size,
                        peer->addr, &peer->addrlen);
                return len;
        }
-
 next_recv:
+       /* FIXME: What about using a loop here and continue instead of goto???? */
        /* FWP_EPOINT_RELIABLE */
        fdset = epoint->fdset;
        FWP_DEBUG("Before select\n");
index c89d06e69fb85e2dc84ae112262d1b6bb49fab15..9e17b9449396eabb0f54763c422b10c122a34b6e 100644 (file)
@@ -11,6 +11,8 @@
 
 /* buffer and socket for incomming message */
 static unsigned char   buffer[FWP_MTU];
+/* FIXME: This could be moved to local static variable in
+ * fwp_mngt_input() */
 
 /* Admission control test */
 fwp_admctrl_test_t fwp_admctrl_test = &fwp_admctrl_stupid;
@@ -210,11 +212,12 @@ void fwp_mngr_msg_handler(fwp_msgb_t *msgb)
 void fwp_mngr_main_loop()
 {
        struct fwp_msgb *msgb;
+       int rv;
 
        /* start admission control thread */
        while (1 /*exit_flag*/){
-               fwp_mngr_input(&msgb);
-               if (msgb)
+               rv = fwp_mngr_input(&msgb);
+               if (rv == 0 && msgb)
                        fwp_mngr_msg_handler(msgb);
                FWP_DEBUG("Mngr waiting for next msg.\n");
        }