Because ngx_http_upstream_finalize_request sends NGX_HTTP_LAST, having last_buf=1 in our module meant that last two chains always had last_buf=1, which resulted in duplicated last chunk sent for HTTP/1.1 requests. This pretty much killed keep-alived requests. Reported by Silly Sad, diagnosed by Maxim Dounin. Same issue was independently diagnosed and fixed in ngx_drizzle by Yichun Zhang (agentzh) few days ago.
…art from most of the ngx_log_error calls in ngx_postgres_keepalive.c because they are duplicate with the << upstream: "postgres://ip.add.re.ss:port" >> part automatically generated by the ngx_http_log_error_handler function in the nginx core.
…d "sockaddr" fields instead of passing pointers around.
…, "sockaddr", and "socklen" fields for the connection from the pool such that we can get more detailed error log messages with the "upstream: postgres://ip.add.re.ss:port" bit.
Calling PQconnectStartParams(NULL, *, *) results in SIGSEGV.
The problem is that this value shouldn't be used in the first place (see next commit). This reverts commit 1ed9f15.
This is great feature, but the way it hooks into configuration must be rewritten (as discussed with Yichun on the IRC). This reverts commit 4187c57.
I've just tested each case and there is no such bug in ngx_postgres, each error.log entry contains correct upstream peer name. I'll re-add "pc->name = &peer->name;" in case nginx or 3rd-party modules will ever use it, but "pc->name" isn't used by ngx_postgres. This reverts commit 8126a4f.
r->upstream->peer.name in the get_peer function which caused error messages lacking upstream peer names and ports.
…ould always initialize pglcf->output_value->required.