repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 89e73ad4b4e66921fc20c5afbe17042aee77a329:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 89e73ad4b4e66921fc20c5afbe17042aee77a329
Author: Alexander Barton 
Date:   Fri May 21 22:48:34 2010 +0200

    Refactoring: Rename CONNECTION.res_stat to .proc_stat

    We want to use this process status variable not only for the
    resolver subprocesses but other asynchronous tasks as well;
    so let's name it more generic.

diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 495c54f1d81a34ec00505ad7695f56ca369b3bf5..
index ..91ff779677c969ec9b8ee299de386cd75f606097 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -755,7 +755,7 @@ 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)) {
+			if (Proc_InProgress(&My_Connections[i].proc_stat)) {
 				/* Wait for completion of resolver sub-process ... */
 				io_event_del(My_Connections[i].sock,
 					     IO_WANTREAD);
@@ -1074,8 +1074,8 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 	}

 	/* cancel running resolver */
-	if (Proc_InProgress(&My_Connections[Idx].res_stat))
-		Proc_Kill(&My_Connections[Idx].res_stat);
+	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 +1377,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 +1889,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 +2003,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 +2015,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;

diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h
index 2ca0d6289b992b88b76d38fd5ccba5f9d6541c85..
index ..7665bb374166bc501c19c6057cb7afd68e0dca63 100644
--- a/src/ngircd/conn.h
+++ b/src/ngircd/conn.h
@@ -69,7 +69,7 @@ typedef struct _Connection
 {
 	int sock;			/* Socket handle */
 	ng_ipaddr_t addr;		/* Client address */
-	PROC_STAT res_stat;		/* Status of resolver process */
+	PROC_STAT proc_stat;		/* Status of resolver process */
 	char host[HOST_LEN];		/* Hostname */
 	array rbuf;			/* Read buffer */
 	array wbuf;			/* Write buffer */

-----END OF PAGE-----