diff options
author | Omar Polo <op@omarpolo.com> | 2023-07-01 18:41:46 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-07-01 18:41:46 +0000 |
commit | 2c3810687f0c8b7c14897618c5a3147f949df408 (patch) | |
tree | 0c1a806a390a78088f0cd8625e30bd61d71c8e80 /ge.c | |
parent | 2247b66842be7049e4dbfe099781bd3d2f69fbe9 (diff) |
change log_request to take the code and meta unpacked
don't know what i was smoking when I wrote log_request() like that...
Diffstat (limited to 'ge.c')
-rw-r--r-- | ge.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -40,7 +40,7 @@ static const struct option opts[] = { }; void -log_request(struct client *c, char *meta, size_t l) +log_request(struct client *c, int code, const char *meta) { char b[GEMINI_URL_LEN]; const char *t; @@ -70,11 +70,8 @@ log_request(struct client *c, char *meta, size_t l) strlcpy(b, t, sizeof(b)); } - if ((t = memchr(meta, '\r', l)) == NULL) - t = meta + l; - - fprintf(stderr, "%s:%s GET %s %.*s\n", c->rhost, c->rserv, b, - (int)(t-meta), meta); + fprintf(stderr, "%s:%s GET %s %d %s\n", c->rhost, c->rserv, b, + code, meta); } void |