sending http requests instant now.
[citadel.git] / citadel / sysdep.c
index 8715bc6802dbb9d14e6bf4f860df937d508f123d..74330fe12f914b75e91510437565c63d9d473f30 100644 (file)
@@ -527,13 +527,14 @@ int client_write(const char *buf, int nbytes)
                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);
+               if (fd)
+               {
+                   fprintf(fd, "Sending: BufSize: %d BufContent: [",
+                           nbytes);
+                   rv = fwrite(buf, nbytes, 1, fd);
+                   fprintf(fd, "]\n");
+                   fclose(fd);
+               }
        }
 #endif
 //     flush_client_inbuf();