mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
moved discard_leading_iobuf_bytes() out from conditional
This commit is contained in:
1 parent
5825e3ea74
commit
fdd086b11c
1 file changed
+7
-7
+7
-7
@@ -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) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
Reference in new issue
Block a user