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
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 */
/* 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;
}
{
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);
}
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
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];
/*
* 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
/* 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;
/* 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;
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;
/*
* 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
#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) {
#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) {