+ /* So that we don't keep the context list locked for a long time
+ * we create a copy of it first
+ */
+
+
+ nContexts = num_sessions;
+ nptr = malloc(sizeof(struct CitContext) * nContexts);
+ if (!nptr)
+ {
+ /* Couldn't malloc so we have to bail but stick to the protocol */
+ cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
+ 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);
+