moved discard_leading_iobuf_bytes() out from conditional

This commit is contained in:
Sergey Lyubka 2014-01-20 08:55:34 +00:00
parent 5825e3ea74
commit fdd086b11c

View File

@ -791,6 +791,13 @@ static int is_error(int n) {
return n == 0 || (n < 0 && errno != EINTR && errno != EAGAIN);
}
static void discard_leading_iobuf_bytes(struct iobuf *io, int n) {
if (n >= 0 && n <= io->len) {
memmove(io->buf, io->buf + n, io->len - n);
io->len -= n;
}
}
#ifndef NO_CGI
#ifdef _WIN32
struct threadparam {
@ -1184,13 +1191,6 @@ static void read_from_cgi(struct connection *conn) {
}
}
static void discard_leading_iobuf_bytes(struct iobuf *io, int n) {
if (n >= 0 && n <= io->len) {
memmove(io->buf, io->buf + n, io->len - n);
io->len -= n;
}
}
static void forward_post_data(struct connection *conn) {
struct iobuf *io = &conn->local_iobuf;
int n = send(conn->endpoint.cgi_sock, io->buf, io->len, 0);