X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Frwho%2Fserv_rwho.c;fp=citadel%2Fmodules%2Frwho%2Fserv_rwho.c;h=5329bc70aaf9ab2aec92cd287a86759dc862b87b;hp=4c2e28cdc80495e92c7254bdb2d8d84eec588f0a;hb=9571de81331e169c042c630800bff1bde499c8a9;hpb=c51a64e8f8b42b6efd85f17c91178437d73a9c3d diff --git a/citadel/modules/rwho/serv_rwho.c b/citadel/modules/rwho/serv_rwho.c index 4c2e28cdc..5329bc70a 100644 --- a/citadel/modules/rwho/serv_rwho.c +++ b/citadel/modules/rwho/serv_rwho.c @@ -214,6 +214,70 @@ void cmd_rwho(char *argbuf) { cprintf("000\n"); } +/* + * check for async io jobs that are stuck (didn't ping back for 10 mins) + */ +void dead_io_check(void) { + struct CitContext *nptr; + int nContexts, i; + char real_room[ROOMNAMELEN]; + + /* So that we don't keep the context list locked for a long time + * we create a copy of it first + */ + nptr = CtdlGetContextArray(&nContexts) ; + if (!nptr) + { + /* Couldn't malloc so we have to bail but stick to the protocol */ + return; + } + + time_t now = time(NULL); + time_t idle; + + for (i=0; i