]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
Update comments: subprocesses not only can be resolver processes
[ngircd-alex.git] / src / ngircd / conn.c
index 495c54f1d81a34ec00505ad7695f56ca369b3bf5..dff9336f65af4c2f7e581185d1396047e7b5d92b 100644 (file)
@@ -755,8 +755,9 @@ Conn_Handler(void)
                        if (SSL_WantWrite(&My_Connections[i]))
                                continue; /* TLS/SSL layer needs to write data; deal with this first */
 #endif
-                       if (Proc_InProgress(&My_Connections[i].res_stat)) {
-                               /* Wait for completion of resolver sub-process ... */
+                       if (Proc_InProgress(&My_Connections[i].proc_stat)) {
+                               /* Wait for completion of forked subprocess
+                                * and ignore the socket in the meantime ... */
                                io_event_del(My_Connections[i].sock,
                                             IO_WANTREAD);
                                continue;
@@ -772,6 +773,7 @@ Conn_Handler(void)
                                             IO_WANTREAD);
                                continue;
                        }
+
                        io_event_add(My_Connections[i].sock, IO_WANTREAD);
                }
 
@@ -1073,9 +1075,9 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
                    in_k, out_k);
        }
 
-       /* cancel running resolver */
-       if (Proc_InProgress(&My_Connections[Idx].res_stat))
-               Proc_Kill(&My_Connections[Idx].res_stat);
+       /* Kill possibly running subprocess */
+       if (Proc_InProgress(&My_Connections[Idx].proc_stat))
+               Proc_Kill(&My_Connections[Idx].proc_stat);
 
        /* Servers: Modify time of next connect attempt? */
        Conf_UnsetServer( Idx );
@@ -1377,7 +1379,7 @@ New_Connection(int Sock)
                identsock = -1;
 #endif
        if (!Conf_NoDNS)
-               Resolve_Addr(&My_Connections[new_sock].res_stat, &new_addr,
+               Resolve_Addr(&My_Connections[new_sock].proc_stat, &new_addr,
                             identsock, cb_Read_Resolver_Result);
 
        /* ngIRCd waits up to 4 seconds for the result of the asynchronous
@@ -1889,7 +1891,7 @@ Init_Conn_Struct(CONN_ID Idx)
        My_Connections[Idx].signon = now;
        My_Connections[Idx].lastdata = now;
        My_Connections[Idx].lastprivmsg = now;
-       Proc_InitStruct(&My_Connections[Idx].res_stat);
+       Proc_InitStruct(&My_Connections[Idx].proc_stat);
 } /* Init_Conn_Struct */
 
 
@@ -2003,7 +2005,7 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
        /* Search associated connection ... */
        for( i = 0; i < Pool_Size; i++ ) {
                if(( My_Connections[i].sock != NONE )
-                 && (Proc_GetPipeFd(&My_Connections[i].res_stat) == r_fd))
+                 && (Proc_GetPipeFd(&My_Connections[i].proc_stat) == r_fd))
                        break;
        }
        if( i >= Pool_Size ) {
@@ -2015,7 +2017,7 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
        }
 
        /* Read result from pipe */
-       len = Resolve_Read(&My_Connections[i].res_stat, readbuf, sizeof readbuf -1);
+       len = Resolve_Read(&My_Connections[i].proc_stat, readbuf, sizeof readbuf -1);
        if (len == 0)
                return;