aboutsummaryrefslogtreecommitdiff
path: root/fcgi.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-05-15 11:10:55 +0000
committerOmar Polo <op@omarpolo.com>2021-05-15 11:10:55 +0000
commitd1051bfaa091850cc98f54b07577f2f721890acd (patch)
treece3d57b229671dd77656708fec3da16c0178edd5 /fcgi.c
parent1feaf2a618ee1c4771fee80ced7acf31fe40fdae (diff)
define some more fcgi param
Diffstat (limited to 'fcgi.c')
-rw-r--r--fcgi.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/fcgi.c b/fcgi.c
index fe4db2f..ddb4af6 100644
--- a/fcgi.c
+++ b/fcgi.c
@@ -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);