mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-19 16:13:07 +08:00
moved discard_leading_iobuf_bytes() out from conditional
This commit is contained in:
parent
5825e3ea74
commit
fdd086b11c
14
mongoose.c
14
mongoose.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user