]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] removed the ->h member in struct buffer
authorWilly Tarreau <w@1wt.eu>
Sun, 18 Mar 2007 15:31:29 +0000 (16:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Mar 2007 15:31:29 +0000 (16:31 +0100)
The buffer does not need the header pointer anymore, it has
been removed everywhere.

include/proto/buffers.h
include/types/buffers.h
src/buffers.c
src/stream_sock.c

index 86f414aa5b509b1295567ad2abf65254d536c33f..2b5d0561d6dbce7fb8fb3366ca27f06aa5651acf 100644 (file)
@@ -2,7 +2,7 @@
   include/proto/buffers.h
   Buffer management definitions, macros and inline functions.
 
-  Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
+  Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -34,7 +34,7 @@
 static inline void buffer_init(struct buffer *buf)
 {
        buf->l = buf->total = buf->flags = 0;
-       buf->rlim = buf->h = buf->r = buf->lr = buf->w = buf->data;
+       buf->rlim = buf->r = buf->lr = buf->w = buf->data;
 }
 
 /* returns 1 if the buffer is empty, 0 otherwise */
@@ -51,7 +51,7 @@ static inline int buffer_isfull(const struct buffer *buf) {
 /* flushes any content from buffer <buf> */
 static inline void buffer_flush(struct buffer *buf)
 {
-       buf->r = buf->h = buf->lr = buf->w = buf->data;
+       buf->r = buf->lr = buf->w = buf->data;
        buf->l = 0;
 }
 
@@ -76,7 +76,7 @@ static inline int buffer_realign(struct buffer *buf)
 {
        if (buf->l == 0) {
                /* let's realign the buffer to optimize I/O */
-               buf->r = buf->w = buf->h = buf->lr = buf->data;
+               buf->r = buf->w = buf->lr = buf->data;
        }
        return buffer_max(buf);
 }
index 1788826f82b57f0ec2f6db337ea4c7662bea1902..4afc293e3c6c828304cac77ddac3a829d30220a8 100644 (file)
@@ -2,7 +2,7 @@
   include/types/buffers.h
   Buffer management definitions, macros and inline functions.
 
-  Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
+  Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -67,7 +67,7 @@ struct buffer {
        int wto;                        /* write timeout */
        int cto;                        /* connect timeout */
        unsigned int l;                 /* data length */
-       char *r, *w, *h, *lr;           /* read ptr, write ptr, last header ptr, last read */
+       char *r, *w, *lr;               /* read ptr, write ptr, last read */
        char *rlim;                     /* read limit, used for header rewriting */
        unsigned long long total;       /* total data read */
        char data[BUFSIZE];
index 8dfa857966b41a80090c0cd625a38e559a1cff7b..736e4cce04e3a0db813c15e5978ba9c835b22080 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Buffer management functions.
  *
- * Copyright 2000-2006 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2007 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -95,7 +95,6 @@ int buffer_replace(struct buffer *b, char *pos, char *end, char *str)
        /* we only move data after the displaced zone */
        if (b->r  > pos) b->r  += delta;
        if (b->w  > pos) b->w  += delta;
-       if (b->h  > pos) b->h  += delta;
        if (b->lr > pos) b->lr += delta;
        b->l += delta;
 
@@ -131,7 +130,6 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, char *str, int len)
        /* we only move data after the displaced zone */
        if (b->r  > pos) b->r  += delta;
        if (b->w  > pos) b->w  += delta;
-       if (b->h  > pos) b->h  += delta;
        if (b->lr > pos) b->lr += delta;
        b->l += delta;
 
@@ -160,8 +158,8 @@ int chunk_printf(struct chunk *chk, int size, const char *fmt, ...)
 void buffer_dump(FILE *o, struct buffer *b, int from, int to)
 {
        fprintf(o, "Dumping buffer %p\n", b);
-       fprintf(o, "  data=%p l=%d r=%p w=%p h=%p lr=%p\n",
-               b->data, b->l, b->r, b->w, b->h, b->lr);
+       fprintf(o, "  data=%p l=%d r=%p w=%p lr=%p\n",
+               b->data, b->l, b->r, b->w, b->lr);
 
        if (!to || to > b->l)
                to = b->l;
index 2f91b0fbce90eb91e86f70db2461795466a9342a..e7a55246da4974550dc36c104c27e7c30d0f846f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Functions operating on SOCK_STREAM and buffers.
  *
- * Copyright 2000-2006 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2007 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -60,7 +60,7 @@ int stream_sock_read(int fd) {
 #endif
                {
                        if (b->l == 0) { /* let's realign the buffer to optimize I/O */
-                               b->r = b->w = b->h = b->lr  = b->data;
+                               b->r = b->w = b->lr  = b->data;
                                max = b->rlim - b->data;
                        }
                        else if (b->r > b->w) {
@@ -156,7 +156,7 @@ int stream_sock_write(int fd) {
 #endif
 
        if (b->l == 0) { /* let's realign the buffer to optimize I/O */
-               b->r = b->w = b->h = b->lr  = b->data;
+               b->r = b->w = b->lr  = b->data;
                max = 0;
        }
        else if (b->r > b->w) {