patches: fixed styles.

pull/295/head
Datong Sun 8 years ago
parent 8072a7306f
commit f16a6b2d0f
No known key found for this signature in database
GPG Key ID: CF7004EE981151C8

@ -32,20 +32,22 @@ index 526de3a..b531ce1 100644
void *data) void *data)
{ {
diff --git a/src/stream/ngx_stream_upstream_round_robin.h b/src/stream/ngx_stream_upstream_round_robin.h diff --git a/src/stream/ngx_stream_upstream_round_robin.h b/src/stream/ngx_stream_upstream_round_robin.h
index 35d9fce..c721833 100644 index 35d9fce..75f3e31 100644
--- a/src/stream/ngx_stream_upstream_round_robin.h --- a/src/stream/ngx_stream_upstream_round_robin.h
+++ b/src/stream/ngx_stream_upstream_round_robin.h +++ b/src/stream/ngx_stream_upstream_round_robin.h
@@ -141,6 +141,13 @@ ngx_int_t ngx_stream_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, @@ -142,5 +142,15 @@ ngx_int_t ngx_stream_upstream_get_round_robin_peer(ngx_peer_connection_t *pc,
void *data);
void ngx_stream_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void ngx_stream_upstream_free_round_robin_peer(ngx_peer_connection_t *pc,
void *data, ngx_uint_t state); void *data, ngx_uint_t state);
+#if (NGX_STREAM_SSL)
+ngx_int_t ngx_stream_upstream_set_round_robin_peer_session( +ngx_int_t ngx_stream_upstream_set_round_robin_peer_session(
+ ngx_peer_connection_t *pc, void *data); + ngx_peer_connection_t *pc, void *data);
+void ngx_stream_upstream_save_round_robin_peer_session( +void ngx_stream_upstream_save_round_robin_peer_session(
+ ngx_peer_connection_t *pc, void *data); + ngx_peer_connection_t *pc, void *data);
+#endif
+ +
+ +
+#define HAVE_NGX_STREAM_BALANCER_EXPORT_PATCH 1 +#define HAVE_NGX_STREAM_BALANCER_EXPORT_PATCH 1
+
#endif /* _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_ */ #endif /* _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_ */

@ -1,8 +1,8 @@
diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h
index 09d2459..434965f 100644 index 09d2459..a4dda5d 100644
--- a/src/stream/ngx_stream.h --- a/src/stream/ngx_stream.h
+++ b/src/stream/ngx_stream.h +++ b/src/stream/ngx_stream.h
@@ -241,6 +241,14 @@ typedef struct { @@ -241,6 +241,15 @@ typedef struct {
} ngx_stream_module_t; } ngx_stream_module_t;
@ -11,13 +11,14 @@ index 09d2459..434965f 100644
+ ngx_msec_t timeout; + ngx_msec_t timeout;
+} ngx_stream_proxy_ctx_t; +} ngx_stream_proxy_ctx_t;
+ +
+
+#define NGX_STREAM_HAVE_PROXY_TIMEOUT_FIELDS_PATCH 1 +#define NGX_STREAM_HAVE_PROXY_TIMEOUT_FIELDS_PATCH 1
+ +
+ +
#define NGX_STREAM_MODULE 0x4d525453 /* "STRM" */ #define NGX_STREAM_MODULE 0x4d525453 /* "STRM" */
#define NGX_STREAM_MAIN_CONF 0x02000000 #define NGX_STREAM_MAIN_CONF 0x02000000
@@ -294,6 +302,7 @@ void ngx_stream_finalize_session(ngx_stream_session_t *s, ngx_uint_t rc); @@ -294,6 +303,7 @@ void ngx_stream_finalize_session(ngx_stream_session_t *s, ngx_uint_t rc);
extern ngx_module_t ngx_stream_module; extern ngx_module_t ngx_stream_module;
extern ngx_uint_t ngx_stream_max_module; extern ngx_uint_t ngx_stream_max_module;
extern ngx_module_t ngx_stream_core_module; extern ngx_module_t ngx_stream_core_module;
@ -26,14 +27,14 @@ index 09d2459..434965f 100644
typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s, typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s,
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index 0afde1c..f197c83 100644 index 0afde1c..c16db76 100644
--- a/src/stream/ngx_stream_proxy_module.c --- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c +++ b/src/stream/ngx_stream_proxy_module.c
@@ -359,6 +359,7 @@ ngx_stream_proxy_handler(ngx_stream_session_t *s) @@ -359,6 +359,7 @@ ngx_stream_proxy_handler(ngx_stream_session_t *s)
ngx_stream_proxy_srv_conf_t *pscf; ngx_stream_proxy_srv_conf_t *pscf;
ngx_stream_upstream_srv_conf_t *uscf, **uscfp; ngx_stream_upstream_srv_conf_t *uscf, **uscfp;
ngx_stream_upstream_main_conf_t *umcf; ngx_stream_upstream_main_conf_t *umcf;
+ ngx_stream_proxy_ctx_t *sctx; + ngx_stream_proxy_ctx_t *pctx;
c = s->connection; c = s->connection;
@ -41,16 +42,16 @@ index 0afde1c..f197c83 100644
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0, ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
"proxy connection handler"); "proxy connection handler");
+ sctx = ngx_palloc(c->pool, sizeof(ngx_stream_proxy_ctx_t)); + pctx = ngx_palloc(c->pool, sizeof(ngx_stream_proxy_ctx_t));
+ if (sctx == NULL) { + if (sctx == NULL) {
+ ngx_stream_proxy_finalize(s, NGX_STREAM_INTERNAL_SERVER_ERROR); + ngx_stream_proxy_finalize(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
+ return; + return;
+ } + }
+ +
+ sctx->connect_timeout = pscf->connect_timeout; + pctx->connect_timeout = pscf->connect_timeout;
+ sctx->timeout = pscf->timeout; + pctx->timeout = pscf->timeout;
+ +
+ ngx_stream_set_ctx(s, sctx, ngx_stream_proxy_module); + ngx_stream_set_ctx(s, pctx, ngx_stream_proxy_module);
+ +
u = ngx_pcalloc(c->pool, sizeof(ngx_stream_upstream_t)); u = ngx_pcalloc(c->pool, sizeof(ngx_stream_upstream_t));
if (u == NULL) { if (u == NULL) {

Loading…
Cancel
Save