diff options
author | Omar Polo <op@omarpolo.com> | 2021-05-15 11:10:55 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-05-15 11:10:55 +0000 |
commit | d1051bfaa091850cc98f54b07577f2f721890acd (patch) | |
tree | ce3d57b229671dd77656708fec3da16c0178edd5 /fcgi.c | |
parent | 1feaf2a618ee1c4771fee80ced7acf31fe40fdae (diff) |
define some more fcgi param
Diffstat (limited to 'fcgi.c')
-rw-r--r-- | fcgi.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -456,13 +456,28 @@ err: void send_fcgi_req(struct fcgi *f, struct client *c) { + char addr[NI_MAXHOST]; + const char *t; + int e; + + e = getnameinfo((struct sockaddr*)&c->addr, sizeof(c->addr), + addr, sizeof(addr), + NULL, 0, + NI_NUMERICHOST); + if (e != 0) + fatal("getnameinfo failed"); + c->next = NULL; fcgi_begin_request(f->fd, c->id); - fcgi_send_param(f->fd, c->id, "QUERY_STRING", c->iri.query); fcgi_send_param(f->fd, c->id, "GEMINI_URL_PATH", c->iri.path); + fcgi_send_param(f->fd, c->id, "QUERY_STRING", c->iri.query); + fcgi_send_param(f->fd, c->id, "REMOTE_ADDR", addr); + fcgi_send_param(f->fd, c->id, "REMOTE_HOST", addr); + fcgi_send_param(f->fd, c->id, "REQUEST_METHOD", ""); + fcgi_send_param(f->fd, c->id, "SERVER_NAME", c->iri.host); + fcgi_send_param(f->fd, c->id, "SERVER_PROTOCOL", "GEMINI"); fcgi_send_param(f->fd, c->id, "SERVER_SOFTWARE", "gmid/1.7"); - /* ... */ if (fcgi_end_param(f->fd, c->id) == -1) close_all(f); |