Commit fdd086b1 authored by Sergey Lyubka's avatar Sergey Lyubka

moved discard_leading_iobuf_bytes() out from conditional

parent 5825e3ea
...@@ -791,6 +791,13 @@ static int is_error(int n) { ...@@ -791,6 +791,13 @@ static int is_error(int n) {
return n == 0 || (n < 0 && errno != EINTR && errno != EAGAIN); 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 #ifndef NO_CGI
#ifdef _WIN32 #ifdef _WIN32
struct threadparam { struct threadparam {
...@@ -1184,13 +1191,6 @@ static void read_from_cgi(struct connection *conn) { ...@@ -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) { static void forward_post_data(struct connection *conn) {
struct iobuf *io = &conn->local_iobuf; struct iobuf *io = &conn->local_iobuf;
int n = send(conn->endpoint.cgi_sock, io->buf, io->len, 0); int n = send(conn->endpoint.cgi_sock, io->buf, io->len, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment