[CLEANUP] buffer_flush() was misleading, rename it as buffer_erase

This commit is contained in:
Willy Tarreau 2009-03-08 20:33:29 +01:00
parent ed066fae25
commit 6f0aa476bd
3 changed files with 13 additions and 13 deletions

View File

@ -108,11 +108,11 @@ static inline void buffer_forward(struct buffer *buf, unsigned int bytes)
buf->send_max += data_left;
}
/* Flush any content from buffer <buf> and adjusts flags accordingly. Note
/* Erase any content from buffer <buf> and adjusts flags accordingly. Note
* that any spliced data is not affected since we may not have any access to
* it.
*/
static inline void buffer_flush(struct buffer *buf)
static inline void buffer_erase(struct buffer *buf)
{
buf->send_max = 0;
buf->to_forward = 0;

View File

@ -540,13 +540,13 @@ int http_find_header(const char *name,
* stream interface is assumed to be already in a closed state. An optional
* message is copied into the input buffer, and an HTTP status code stored.
* The error flags are set to the values in arguments. Any pending request
* is flushed.
* in this buffer will be lost.
*/
static void http_server_error(struct session *t, struct stream_interface *si,
int err, int finst, int status, const struct chunk *msg)
{
buffer_flush(si->ob);
buffer_flush(si->ib);
buffer_erase(si->ob);
buffer_erase(si->ib);
buffer_write_ena(si->ib);
if (status > 0 && msg) {
t->txn.status = status;
@ -2304,8 +2304,8 @@ int http_process_request(struct session *s, struct buffer *req)
* eventually expire. We build the tarpit as an analyser.
*/
if (txn->flags & TX_CLTARPIT) {
buffer_flush(s->req);
/* flush the request so that we can drop the connection early
buffer_erase(s->req);
/* wipe the request out so that we can drop the connection early
* if the client closes first.
*/
buffer_write_dis(req);

View File

@ -59,14 +59,14 @@ void stream_int_report_error(struct stream_interface *si)
}
/*
* Returns a message into the output buffer, and flushes the input buffer. The
* output buffer doesn't need to be empty before this. The message is contained
* in a "chunk". If it is null, then an empty message is used.
* Erase any content from input and output buffers, and return a message into
* the output buffer. The message is provided as a "chunk". If it is null,
* then an empty message is used.
*/
void stream_int_return(struct stream_interface *si, const struct chunk *msg)
{
buffer_flush(si->ib);
buffer_flush(si->ob);
buffer_erase(si->ib);
buffer_erase(si->ob);
if (msg && msg->len)
buffer_write(si->ob, msg->str, msg->len);
}
@ -83,7 +83,7 @@ void stream_int_return(struct stream_interface *si, const struct chunk *msg)
void stream_int_retnclose(struct stream_interface *si, const struct chunk *msg)
{
buffer_abort(si->ib);
buffer_flush(si->ob);
buffer_erase(si->ob);
buffer_shutr_now(si->ob);
if (msg && msg->len)
buffer_write(si->ob, msg->str, msg->len);