* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
- * Revision 1.14 1996/01/12 13:08:07 adam
+ * Revision 1.15 1996/01/24 08:25:32 adam
+ * Buf fix: Uninitialized outbuffer_offset member.
+ *
+ * Revision 1.14 1996/01/12 13:08:07 adam
* CGI script passes name of lock file to the shell. The server will not close
* the response FIFO until this file becomes unlocked. This method handles
* cancel operations much better.
{
if (wc->outbuffer_offset + len >= wc->outbuffer_size)
wc->outbuffer = realloc(wc->outbuffer, wc->outbuffer_size +=
- OUTBUFFER_CHUNK);
+ ((len >= OUTBUFFER_CHUNK) ? len*2 : OUTBUFFER_CHUNK));
memcpy(wc->outbuffer + wc->outbuffer_offset, s, len);
wc->outbuffer_offset += len;
}
void wo_clear (WCLIENT wc, const char *type)
{
- if (!wc->outbuffer)
- wc->outbuffer = malloc(wc->outbuffer_size = OUTBUFFER_CHUNK);
wc->outbuffer_offset = 0;
if (type)
wo_printf(wc, "Content-type: %s\n\n", type);
exit(1);
}
new->outbuffer = 0;
+ new->outbuffer_size = 0;
+ new->outbuffer_offset = 0;
new->cache_level = -1;
new->cache_fd = -1;
return new;