Commit 1ee1e3af authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

disconnect any subscriber which receives a not OK response when writing to its socket

parent 73e503c8
...@@ -27,6 +27,6 @@ ...@@ -27,6 +27,6 @@
#define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ #define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_
static const ngx_str_t NGX_HTTP_PUSH_STREAM_TAG = ngx_string("0.3.2"); static const ngx_str_t NGX_HTTP_PUSH_STREAM_TAG = ngx_string("0.3.2");
static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("6796034c6ae6b627d0f31e613287a425f22dd97a"); static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("73e503c8a3f678dabd55a93a23a226c7730fa7be");
#endif /* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */ #endif /* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */
...@@ -414,7 +414,7 @@ ngx_http_push_stream_respond_to_subscribers(ngx_http_push_stream_channel_t *chan ...@@ -414,7 +414,7 @@ ngx_http_push_stream_respond_to_subscribers(ngx_http_push_stream_channel_t *chan
cur = prev; cur = prev;
} else { } else {
if (ngx_http_push_stream_send_response_message(subscriber->request, channel, msg) == NGX_ERROR) { if (ngx_http_push_stream_send_response_message(subscriber->request, channel, msg) != NGX_OK) {
ngx_http_push_stream_queue_elem_t *prev = (ngx_http_push_stream_queue_elem_t *) ngx_queue_prev(&cur->queue); ngx_http_push_stream_queue_elem_t *prev = (ngx_http_push_stream_queue_elem_t *) ngx_queue_prev(&cur->queue);
ngx_http_push_stream_send_response_finalize(subscriber->request); ngx_http_push_stream_send_response_finalize(subscriber->request);
cur = prev; cur = prev;
......
...@@ -946,7 +946,7 @@ ngx_http_push_stream_ping_timer_wake_handler(ngx_event_t *ev) ...@@ -946,7 +946,7 @@ ngx_http_push_stream_ping_timer_wake_handler(ngx_event_t *ev)
rc = ngx_http_push_stream_send_response_message(r, NULL, ngx_http_push_stream_ping_msg); rc = ngx_http_push_stream_send_response_message(r, NULL, ngx_http_push_stream_ping_msg);
} }
if (rc == NGX_ERROR) { if (rc != NGX_OK) {
ngx_http_push_stream_send_response_finalize(r); ngx_http_push_stream_send_response_finalize(r);
} else { } else {
ngx_http_push_stream_subscriber_ctx_t *ctx = ngx_http_get_module_ctx(r, ngx_http_push_stream_module); ngx_http_push_stream_subscriber_ctx_t *ctx = ngx_http_get_module_ctx(r, ngx_http_push_stream_module);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment