ngx_flag_t half_close;
ngx_stream_upstream_local_t *local;
ngx_flag_t socket_keepalive;
+ size_t socket_rcvbuf;
+ size_t socket_sndbuf;
#if (NGX_STREAM_SSL)
ngx_flag_t ssl_enable;
offsetof(ngx_stream_proxy_srv_conf_t, socket_keepalive),
NULL },
+ { ngx_string("proxy_socket_rcvbuf"),
+ NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_size_slot,
+ NGX_STREAM_SRV_CONF_OFFSET,
+ offsetof(ngx_stream_proxy_srv_conf_t, socket_rcvbuf),
+ NULL },
+
+ { ngx_string("proxy_socket_sndbuf"),
+ NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_size_slot,
+ NGX_STREAM_SRV_CONF_OFFSET,
+ offsetof(ngx_stream_proxy_srv_conf_t, socket_sndbuf),
+ NULL },
+
{ ngx_string("proxy_connect_timeout"),
NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
ngx_conf_set_msec_slot,
u->peer.so_keepalive = 1;
}
+ if (pscf->socket_rcvbuf) {
+ u->peer.rcvbuf = (int) pscf->socket_rcvbuf;
+ }
+
+ if (pscf->socket_sndbuf) {
+ u->peer.sndbuf = (int) pscf->socket_sndbuf;
+ }
+
u->peer.type = c->type;
u->start_sec = ngx_time();
conf->proxy_protocol = NGX_CONF_UNSET;
conf->local = NGX_CONF_UNSET_PTR;
conf->socket_keepalive = NGX_CONF_UNSET;
+ conf->socket_rcvbuf = NGX_CONF_UNSET_SIZE;
+ conf->socket_sndbuf = NGX_CONF_UNSET_SIZE;
conf->half_close = NGX_CONF_UNSET;
#if (NGX_STREAM_SSL)
ngx_conf_merge_value(conf->socket_keepalive,
prev->socket_keepalive, 0);
+ ngx_conf_merge_size_value(conf->socket_rcvbuf, prev->socket_rcvbuf, 0);
+
+ ngx_conf_merge_size_value(conf->socket_sndbuf, prev->socket_sndbuf, 0);
+
ngx_conf_merge_value(conf->half_close, prev->half_close, 0);
#if (NGX_STREAM_SSL)