summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-23 18:22:48 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-23 18:22:48 +0000
commit9d0c65ad86112822175ddbf822e1827ca32cf24d (patch)
treec4dd0a06cdefe9e5062a7c38b9eb3745301f7beb /src
parent451fad1ed25b417dac9aebc6a887bfd3691d1f01 (diff)
downloadtinyproxy-9d0c65ad86112822175ddbf822e1827ca32cf24d.tar.gz
tinyproxy-9d0c65ad86112822175ddbf822e1827ca32cf24d.zip
Fixed up the header includes for the new layout.
Changed one line of code to make it explicit how the pointers are to be updated.
Diffstat (limited to '')
-rw-r--r--src/buffer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2d9356b..16bd60a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,4 +1,4 @@
-/* $Id: buffer.c,v 1.20 2002-05-14 00:43:38 rjkaes Exp $
+/* $Id: buffer.c,v 1.21 2002-05-23 18:22:48 rjkaes Exp $
*
* The buffer used in each connection is a linked list of lines. As the lines
* are read in and written out the buffer expands and contracts. Basically,
@@ -24,8 +24,8 @@
#include "tinyproxy.h"
#include "buffer.h"
+#include "heap.h"
#include "log.h"
-#include "utils.h"
#define BUFFER_HEAD(x) (x)->head
#define BUFFER_TAIL(x) (x)->tail
@@ -174,8 +174,10 @@ add_to_buffer(struct buffer_s *buffptr, unsigned char *data, size_t length)
if (buffptr->size == 0)
BUFFER_HEAD(buffptr) = BUFFER_TAIL(buffptr) = newline;
- else
- BUFFER_TAIL(buffptr) = (BUFFER_TAIL(buffptr)->next = newline);
+ else {
+ BUFFER_TAIL(buffptr)->next = newline;
+ BUFFER_TAIL(buffptr) = newline;
+ }
buffptr->size += length;
@@ -274,8 +276,8 @@ write_buffer(int fd, struct buffer_s * buffptr)
/* Sanity check. It would be bad to be using a NULL pointer! */
assert(BUFFER_HEAD(buffptr) != NULL);
-
line = BUFFER_HEAD(buffptr);
+
bytessent =
send(fd, line->string + line->pos, line->length - line->pos, MSG_NOSIGNAL);