/* Promote to time_t; types differ on some OSes (like darwin) */
unixtime = tv.tv_sec;
localtime_r(&unixtime, &tim);
-/*
if (CC->cs_pid != 0) {
sprintf(buf,
"%04d/%02d/%02d %2d:%02d:%02d.%06ld [%3d] ",
tim.tm_mday, tim.tm_hour, tim.tm_min,
tim.tm_sec, (long)tv.tv_usec);
}
-FIXME temp i want to see CC */
- sprintf(buf,
- "%2d:%02d:%02d.%06ld 0x%08lx ",
- tim.tm_hour, tim.tm_min,
- tim.tm_sec, (long)tv.tv_usec, CC);
vsnprintf(buf2, SIZ, format, arg_ptr);
fprintf(stderr, "%s%s", buf, buf2);
}
+struct CitContext *CtdlGetContextArray(int *count)
+{
+ int nContexts, i;
+ struct CitContext *nptr, *cptr;
+
+ nContexts = num_sessions;
+ nptr = malloc(sizeof(struct CitContext) * nContexts);
+ if (!nptr)
+ return NULL;
+ 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);
+
+ *count = i;
+ return nptr;
+}
+
/*
* The following functions implement output buffering. If the kernel supplies
* native TCP buffering (Linux & *BSD), use that; otherwise, emulate it with