$Log$
+ Revision 625.11 2004/09/05 15:20:41 error
+ * sysdep.c: unbuffer_output(): Split the writing part to a new function
+ flush_output() for more precise control
+
Revision 625.10 2004/09/03 04:34:30 ajc
* setup.c: when creating an inittab entry for slapd, use "-d 0" instead
of "-d 1" to avoid spewing messages to the console, while still remaining
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
}
/*
- * unbuffer_output() ... dump out all that output we've been buffering.
+ * flush_output() ... dump out all that output we've been buffering.
+ */
+void flush_output(void) {
+ if (CC->buffering == 1) {
+ client_write(CC->output_buffer, CC->buffer_len);
+ CC->buffer_len = 0;
+ }
+}
+
+/*
+ * unbuffer_output() ... stop buffering output.
*/
void unbuffer_output(void) {
if (CC->buffering == 1) {
+ flush_output();
CC->buffering = 0;
- client_write(CC->output_buffer, CC->buffer_len);
free(CC->output_buffer);
CC->output_buffer = NULL;
- CC->buffer_len = 0;
}
}