* output what we're sending into the BIGBAD_IODBG too.
authorWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 22:00:28 +0000 (22:00 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 1 Sep 2010 22:22:43 +0000 (00:22 +0200)
(cherry picked from commit e6116200be29b3c203a3aa047eadf43245475bed)

citadel/sysdep.c

index 963af9df6aa84e3d081182cb9d954e51136d93f6..18c62b19143482d518016b393c33245f3232ebb5 100644 (file)
@@ -516,8 +516,27 @@ int client_write(const char *buf, int nbytes)
 
        if (nbytes < 1) return(0);
 
-//     flush_client_inbuf();
        Ctx = CC;
+
+#ifdef BIGBAD_IODBG
+       {
+               int rv = 0;
+               char fn [SIZ];
+               FILE *fd;
+               
+               snprintf(fn, SIZ, "/tmp/foolog_%s.%d", Ctx->ServiceName, Ctx->cs_pid);
+               
+               fd = fopen(fn, "a+");
+               fprintf(fd, "Sending: BufSize: %d BufContent: [",
+                       nbytes);
+               rv = fwrite(buf, nbytes, 1, fd);
+               fprintf(fd, "]\n");
+               
+                       
+               fclose(fd);
+       }
+#endif
+//     flush_client_inbuf();
        if (Ctx->redirect_buffer != NULL) {
                StrBufAppendBufPlain(Ctx->redirect_buffer,
                                     buf, nbytes, 0);