Commit Diff
Diff:
e4ffcd00bdbe6d66d419e2f364a0d2dd317202b5
bf8b64630443b2bd3fe2a298f860ea0d492df649
Commit:
bf8b64630443b2bd3fe2a298f860ea0d492df649
Tree:
018ea36621b1fe2c785ced0605c8a36df0fe47d2
Author:
Alexander Barton <alex@barton.de>
Committer:
Alexander Barton <alex@barton.de>
Date:
Sun Jul 11 13:15:23 2010 UTC
Message:
New function Conn_GetProcStat() Get PROC_STAT sub-process structure of a given connection.
blob - 9da618f1aee53ed6ff25a71409ad3bb0038b20b5
blob + f4efff1655002f5687b44b8beb9f9cb38c90fbf2
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
@@ -68,7 +68,6 @@
#include "log.h"
#include "ng_ipaddr.h"
#include "parse.h"
-#include "proc.h"
#include "resolve.h"
#include "tool.h"
@@ -2099,7 +2098,23 @@ Conn_GetClient( CONN_ID Idx )
return c ? c->client : NULL;
}
+/**
+ * Get PROC_STAT sub-process structure of a connection.
+ * @param Idx Connection index number
+ * @return PROC_STAT structure
+ */
+GLOBAL PROC_STAT *
+Conn_GetProcStat(CONN_ID Idx)
+{
+ CONNECTION *c;
+ assert(Idx >= 0);
+ c = array_get(&My_ConnArray, sizeof (CONNECTION), (size_t)Idx);
+ assert(c != NULL);
+ return &c->proc_stat;
+} /* Conn_GetProcStat */
+
+
/**
* Get CONN_ID from file descriptor associated to a subprocess structure.
* @param fd File descriptor
blob - e9b470bcf1327d08bdd3cf0598762ddc831a5326
blob + a63fcbb602ea5f7fe7dd72231538f76346177802
--- src/ngircd/conn.h
+++ src/ngircd/conn.h
@@ -44,11 +44,11 @@
typedef long CONN_ID;
#include "client.h"
+#include "proc.h"
#ifdef CONN_MODULE
#include "defines.h"
-#include "proc.h"
#include "array.h"
#include "tool.h"
#include "ng_ipaddr.h"
@@ -115,6 +115,7 @@ GLOBAL void Conn_SyncServerStruct PARAMS(( void ));
GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd));
GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
+GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
#ifdef SSL_SUPPORT
GLOBAL bool Conn_GetCipherInfo PARAMS((CONN_ID Idx, char *buf, size_t len));
GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
blob - f8c39cf7160962c96e523f66143dee96d1931add
blob + 26ad103cf58deb6eaf2fbb064563408917f2d969
--- src/ngircd/resolve.c
+++ src/ngircd/resolve.c
@@ -35,7 +35,6 @@
#include "defines.h"
#include "log.h"
#include "ng_ipaddr.h"
-#include "proc.h"
#include "exp.h"
#include "resolve.h"
IRCNow