Latest update - 7441
This commit is contained in:
@@ -258,7 +258,9 @@ ngx_event_recvmsg(ngx_event_t *ev)
|
||||
rev = c->read;
|
||||
|
||||
c->udp->buffer = &buf;
|
||||
|
||||
rev->ready = 1;
|
||||
rev->active = 0;
|
||||
|
||||
rev->handler(rev);
|
||||
|
||||
@@ -267,6 +269,7 @@ ngx_event_recvmsg(ngx_event_t *ev)
|
||||
}
|
||||
|
||||
rev->ready = 0;
|
||||
rev->active = 1;
|
||||
|
||||
goto next;
|
||||
}
|
||||
@@ -345,6 +348,7 @@ ngx_event_recvmsg(ngx_event_t *ev)
|
||||
rev = c->read;
|
||||
wev = c->write;
|
||||
|
||||
rev->active = 1;
|
||||
wev->ready = 1;
|
||||
|
||||
rev->log = log;
|
||||
@@ -438,7 +442,9 @@ ngx_udp_shared_recv(ngx_connection_t *c, u_char *buf, size_t size)
|
||||
ngx_memcpy(buf, b->pos, n);
|
||||
|
||||
c->udp->buffer = NULL;
|
||||
|
||||
c->read->ready = 0;
|
||||
c->read->active = 1;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -271,6 +271,34 @@ ngx_http_test_predicates(ngx_http_request_t *r, ngx_array_t *predicates)
|
||||
}
|
||||
|
||||
|
||||
ngx_int_t
|
||||
ngx_http_test_required_predicates(ngx_http_request_t *r,
|
||||
ngx_array_t *predicates)
|
||||
{
|
||||
ngx_str_t val;
|
||||
ngx_uint_t i;
|
||||
ngx_http_complex_value_t *cv;
|
||||
|
||||
if (predicates == NULL) {
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
cv = predicates->elts;
|
||||
|
||||
for (i = 0; i < predicates->nelts; i++) {
|
||||
if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
if (val.len == 0 || (val.len == 1 && val.data[0] == '0')) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
ngx_http_set_predicate_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
{
|
||||
|
||||
@@ -214,6 +214,8 @@ char *ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||
|
||||
ngx_int_t ngx_http_test_predicates(ngx_http_request_t *r,
|
||||
ngx_array_t *predicates);
|
||||
ngx_int_t ngx_http_test_required_predicates(ngx_http_request_t *r,
|
||||
ngx_array_t *predicates);
|
||||
char *ngx_http_set_predicate_slot(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||
void *conf);
|
||||
|
||||
|
||||
@@ -1593,7 +1593,7 @@ ngx_stream_proxy_process(ngx_stream_session_t *s, ngx_uint_t from_upstream,
|
||||
break;
|
||||
}
|
||||
|
||||
if ((off_t) size > limit) {
|
||||
if (c->type == SOCK_STREAM && (off_t) size > limit) {
|
||||
size = (size_t) limit;
|
||||
}
|
||||
}
|
||||
@@ -1667,13 +1667,13 @@ ngx_stream_proxy_process(ngx_stream_session_t *s, ngx_uint_t from_upstream,
|
||||
|
||||
flags = src->read->eof ? NGX_CLOSE_EVENT : 0;
|
||||
|
||||
if (!src->shared && ngx_handle_read_event(src->read, flags) != NGX_OK) {
|
||||
if (ngx_handle_read_event(src->read, flags) != NGX_OK) {
|
||||
ngx_stream_proxy_finalize(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dst) {
|
||||
if (!dst->shared && ngx_handle_write_event(dst->write, 0) != NGX_OK) {
|
||||
if (ngx_handle_write_event(dst->write, 0) != NGX_OK) {
|
||||
ngx_stream_proxy_finalize(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user