projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb4db7b
)
RWHO command uses new function to read the context list safely.
author
Dave West
<davew@uncensored.citadel.org>
Tue, 18 Mar 2008 14:59:28 +0000
(14:59 +0000)
committer
Dave West
<davew@uncensored.citadel.org>
Tue, 18 Mar 2008 14:59:28 +0000
(14:59 +0000)
citadel/modules/rwho/serv_rwho.c
patch
|
blob
|
history
diff --git
a/citadel/modules/rwho/serv_rwho.c
b/citadel/modules/rwho/serv_rwho.c
index 06f439081aa4c69fb9b631233bc5ca2f3b995d35..515c5f6afa7f14e79480fbeed05c139346b3ceb1 100644
(file)
--- a/
citadel/modules/rwho/serv_rwho.c
+++ b/
citadel/modules/rwho/serv_rwho.c
@@
-68,8
+68,7
@@
void cmd_rwho(char *argbuf) {
*/
*/
- nContexts = num_sessions;
- nptr = malloc(sizeof(struct CitContext) * nContexts);
+ nptr = CtdlGetContextArray(&nContexts) ;
if (!nptr)
{
/* Couldn't malloc so we have to bail but stick to the protocol */
if (!nptr)
{
/* Couldn't malloc so we have to bail but stick to the protocol */
@@
-77,12
+76,6
@@
void cmd_rwho(char *argbuf) {
cprintf("000\n");
return;
}
cprintf("000\n");
return;
}
- begin_critical_section(S_SESSION_TABLE);
- for (cptr = ContextList, i=0; cptr != NULL && i < nContexts; cptr = cptr->next, i++)
- {
- memcpy(&nptr[i], cptr, sizeof (struct CitContext));
- }
- end_critical_section (S_SESSION_TABLE);
aide = CC->user.axlevel >= 6;
cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
aide = CC->user.axlevel >= 6;
cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );