Skip to content

Commit

Permalink
bugfix: segmentation fault might happen in ngx_destroy_pool when debu…
Browse files Browse the repository at this point in the history
…g logging was enabled in the nginx build. thanks buddy-ekb for the report in FRiCKLE#21.
  • Loading branch information
agentzh committed Aug 1, 2014
1 parent 0e5ce4a commit 088ab19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ngx_postgres_keepalive.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ ngx_postgres_keepalive_get_peer_single(ngx_peer_connection_t *pc,

c->idle = 0;
c->log = pc->log;
#if defined(nginx_version) && (nginx_version >= 1001004)
c->pool->log = pc->log;
#endif
c->read->log = pc->log;
c->write->log = pc->log;

Expand Down Expand Up @@ -140,6 +143,9 @@ ngx_postgres_keepalive_get_peer_multi(ngx_peer_connection_t *pc,

c->idle = 0;
c->log = pc->log;
#if defined(nginx_version) && (nginx_version >= 1001004)
c->pool->log = pc->log;
#endif
c->read->log = pc->log;
c->write->log = pc->log;

Expand Down Expand Up @@ -235,6 +241,9 @@ ngx_postgres_keepalive_free_peer(ngx_peer_connection_t *pc,
c->data = item;
c->idle = 1;
c->log = ngx_cycle->log;
#if defined(nginx_version) && (nginx_version >= 1001004)
c->pool->log = ngx_cycle->log;
#endif
c->read->log = ngx_cycle->log;
c->write->log = ngx_cycle->log;

Expand Down

0 comments on commit 088ab19

Please sign in to comment.