- {
- int rv = 0;
- char fn [SIZ];
- FILE *fd;
- const char *pch = ChrPtr(IO->SendBuf.Buf);
- const char *pchh = IO->SendBuf.ReadWritePointer;
- long nbytes;
-
- if (pchh == NULL)
- pchh = pch;
-
- nbytes = StrLength(IO->SendBuf.Buf) - (pchh - pch);
- snprintf(fn, SIZ, "/tmp/foolog_ev_%s.%d",
- ((CitContext*)(IO->CitContext))->ServiceName,
- IO->SendBuf.fd);
-
- fd = fopen(fn, "a+");
- fprintf(fd, "Read: BufSize: %ld BufContent: [",
- nbytes);
- rv = fwrite(pchh, nbytes, 1, fd);
- if (!rv) printf("failed to write debug to %s!\n", fn);
- fprintf(fd, "]\n");
-
-
- fclose(fd);
- }