Opps! Fixed a problem with negative numbers. :)
This commit is contained in:
parent
56b541d76b
commit
5140f01d5c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: reqs.c,v 1.46 2001-12-19 05:13:40 rjkaes Exp $
|
/* $Id: reqs.c,v 1.47 2001-12-19 05:19:03 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* This is where all the work in tinyproxy is actually done. Incoming
|
* This is where all the work in tinyproxy is actually done. Incoming
|
||||||
* connections have a new thread created for them. The thread then
|
* connections have a new thread created for them. The thread then
|
||||||
@ -203,8 +203,8 @@ extract_ssl_url(const char *url, struct request_s *request)
|
|||||||
static int
|
static int
|
||||||
write_message(int fd, const char *fmt, ...)
|
write_message(int fd, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
size_t n;
|
ssize_t n;
|
||||||
size_t size = (1024 * 8); /* start with 8 KB and go from there */
|
size_t size = (1024 * 2); /* start with 2 KB and go from there */
|
||||||
char *buf, *tmpbuf;
|
char *buf, *tmpbuf;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
@ -216,6 +216,8 @@ write_message(int fd, const char *fmt, ...)
|
|||||||
n = vsnprintf(buf, size, fmt, ap);
|
n = vsnprintf(buf, size, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
|
DEBUG2("n = %d", n);
|
||||||
|
|
||||||
/* If that worked, break out so we can send the buffer */
|
/* If that worked, break out so we can send the buffer */
|
||||||
if (n > -1 && n < size)
|
if (n > -1 && n < size)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user