aboutsummaryrefslogtreecommitdiff
path: root/ge.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-07-01 18:41:46 +0000
committerOmar Polo <op@omarpolo.com>2023-07-01 18:41:46 +0000
commit2c3810687f0c8b7c14897618c5a3147f949df408 (patch)
tree0c1a806a390a78088f0cd8625e30bd61d71c8e80 /ge.c
parent2247b66842be7049e4dbfe099781bd3d2f69fbe9 (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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ge.c b/ge.c
index 57a02af..d80bc11 100644
--- a/ge.c
+++ b/ge.c
@@ -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