aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gmid.c b/gmid.c
index 7d8f2c8..b59c5a9 100644
--- a/gmid.c
+++ b/gmid.c
@@ -84,18 +84,11 @@ void
log_request(struct client *c, char *meta, size_t l)
{
struct conf *conf = c->conf;
- char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV], b[GEMINI_URL_LEN];
+ char b[GEMINI_URL_LEN];
char *fmted;
const char *t;
int ec;
- ec = getnameinfo((struct sockaddr*)&c->raddr, c->raddrlen,
- hbuf, sizeof(hbuf),
- sbuf, sizeof(sbuf),
- NI_NUMERICHOST | NI_NUMERICSERV);
- if (ec != 0)
- fatalx("getnameinfo: %s", gai_strerror(ec));
-
if (c->iri.schema != NULL) {
/* serialize the IRI */
strlcpy(b, c->iri.schema, sizeof(b));
@@ -124,7 +117,7 @@ log_request(struct client *c, char *meta, size_t l)
if ((t = memchr(meta, '\r', l)) == NULL)
t = meta + l;
- ec = asprintf(&fmted, "%s:%s GET %s %.*s", hbuf, sbuf, b,
+ ec = asprintf(&fmted, "%s:%s GET %s %.*s", c->rhost, c->rserv, b,
(int)(t-meta), meta);
if (ec == -1)
fatal("asprintf");