log more details for FastCGI errors

add the reported request id if there's a mismatch and both the gai error
and the errno value if getnameinfo fails.
This commit is contained in:
Omar Polo 2021-10-02 17:20:10 +00:00
parent 5f37f9c20d
commit b618111a68
1 changed files with 4 additions and 3 deletions

7
fcgi.c
View File

@ -343,8 +343,8 @@ fcgi_read(struct bufferevent *bev, void *d)
c = try_client_by_id(recid(&hdr));
if (c == NULL) {
log_err(NULL,
"got invalid client id from fcgi backend %d",
recid(&hdr));
"got invalid client id %d from fcgi backend %d",
recid(&hdr), fcgi->id);
goto err;
}
@ -463,7 +463,8 @@ fcgi_req(struct fcgi *f, struct client *c)
NULL, 0,
NI_NUMERICHOST);
if (e != 0)
fatal("getnameinfo failed");
fatal("getnameinfo failed: %s (%s)",
gai_strerror(e), strerror(errno));
c->next = NULL;