Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

subscriber_sentinel should be reinitialized, not nulled

  • Loading branch information...
commit 490fddd68a2c5f88cbb1ee553f7b9fd957d5d813 1 parent bfaf31a
@slact slact authored
Showing with 3 additions and 2 deletions.
  1. +1 −0  changelog.txt
  2. +2 −2 src/ngx_http_push_module.c
View
1  changelog.txt
@@ -1,3 +1,4 @@
+ fix: small memory leak after each message broadcast to a channel
feature: optional push_max_channel_subscribers setting added
fix: first-in concurrency setting wasn't responding to subscribers with a correct status code on conflict
fix: reused subscriber connections sometimes failed to receive messages
View
4 src/ngx_http_push_module.c
@@ -522,7 +522,7 @@ static ngx_int_t ngx_http_push_broadcast_locked(ngx_http_push_channel_t *channel
}
ngx_shmtx_lock(&shpool->mutex);
- cur->subscriber_sentinel=NULL; //no messages here, no sir.
+ ngx_queue_init(&subscriber_sentinel->queue); //no messages here, no sir.
}
return received;
}
@@ -770,7 +770,7 @@ static ngx_int_t ngx_http_push_respond_to_subscribers(ngx_http_push_channel_t *c
ngx_slab_pool_t *shpool = (ngx_slab_pool_t *)ngx_http_push_shm_zone->shm.addr;
ngx_queue_t *cur, *next;
ngx_int_t responded_subscribers=0;
- if(sentinel==NULL) {
+ if(sentinel==NULL || ngx_queue_empty(&sentinel->queue)) {
return NGX_OK;
}
Please sign in to comment.
Something went wrong with that request. Please try again.