]> andersk Git - moira.git/blobdiff - server/mr_main.c
modified error handling.
[moira.git] / server / mr_main.c
index 7f78cf6197b3c25c555ca9a19dc3687ce016b775..5aa41a20a2e89e1a4decea6fa5046b96a12f946d 100644 (file)
  *     Let the reader beware.
  * 
  *     $Log$
- *     Revision 1.7  1987-06-08 02:44:44  wesommer
- *     Minor lint fix.
+ *     Revision 1.8  1987-06-09 18:44:45  wesommer
+ *     modified error handling.
  *
+ * Revision 1.7  87/06/08  02:44:44  wesommer
+ * Minor lint fix.
+ * 
  * Revision 1.6  87/06/03  17:41:00  wesommer
  * Added startup support.
  * 
@@ -108,7 +111,9 @@ main(argc, argv)
                com_err(whoami, 0, "GDB initialization failed.");
                exit(1);
        }
-
+       gdb_debug(0); /* this can be patched, if necessary, to enable */
+                     /* GDB level debugging .. */
+       
        /*
         * Database initialization.
         */
@@ -192,7 +197,11 @@ main(argc, argv)
                 * Handle any new connections.
                 */
                if (OP_DONE(listenop)) {
-                       if ((status = new_connection()) != 0) {
+                       if (OP_STATUS(listenop) == OP_CANCELLED) {
+                               com_err(whoami, errno, "Error on listen");
+                               exit(1);
+
+                       } else if ((status = new_connection()) != 0) {
                                com_err(whoami, errno,
                                        "Error on listening operation.");
                                /*
@@ -237,7 +246,7 @@ do_listen()
 int
 new_connection()
 {
-       register client *cp = (client *)malloc(sizeof *cp);
+       register client *cp;
        static counter = 0;
        
        /*
@@ -254,7 +263,7 @@ new_connection()
        /*
         * Set up the new connection and reply to the client
         */
-
+       cp = (client *)malloc(sizeof *cp);
        cp->state = CL_STARTING;
        cp->action = CL_ACCEPT;
        cp->con = newconn;
@@ -354,6 +363,7 @@ clist_delete(cp)
 
        reset_operation(cp->pending_op);
        delete_operation(cp->pending_op);
+       sever_connection(cp->con);
        free((char *)cp);
 }
 
This page took 0.032853 seconds and 4 git commands to generate.