projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd42e5b
)
Buf fix: Uninitialized outbuffer_offset member.
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 24 Jan 1996 08:25:32 +0000
(08:25 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 24 Jan 1996 08:25:32 +0000
(08:25 +0000)
www/wproto.c
patch
|
blob
|
history
diff --git
a/www/wproto.c
b/www/wproto.c
index
51130f9
..
35479b3
100644
(file)
--- a/
www/wproto.c
+++ b/
www/wproto.c
@@
-41,7
+41,10
@@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
* 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.
* 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.
@@
-124,7
+127,7
@@
void wo_write (WCLIENT wc, const char *s, size_t len)
{
if (wc->outbuffer_offset + len >= wc->outbuffer_size)
wc->outbuffer = realloc(wc->outbuffer, wc->outbuffer_size +=
{
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;
}
memcpy(wc->outbuffer + wc->outbuffer_offset, s, len);
wc->outbuffer_offset += len;
}
@@
-147,8
+150,6
@@
void wo_printf (WCLIENT wc, const char *fmt, ...)
void wo_clear (WCLIENT wc, const char *type)
{
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);
wc->outbuffer_offset = 0;
if (type)
wo_printf(wc, "Content-type: %s\n\n", type);
@@
-447,6
+448,8
@@
WCLIENT wproto_init(void)
exit(1);
}
new->outbuffer = 0;
exit(1);
}
new->outbuffer = 0;
+ new->outbuffer_size = 0;
+ new->outbuffer_offset = 0;
new->cache_level = -1;
new->cache_fd = -1;
return new;
new->cache_level = -1;
new->cache_fd = -1;
return new;