diff options
author | Leah Neukirchen <leah@vuxu.org> | 2021-08-10 22:56:14 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2021-08-10 22:56:14 +0200 |
commit | 9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa (patch) | |
tree | 0c769099dec285b2a9ac3574a4fd09b5f8ea6e08 | |
parent | 69a1701438fa91a23b452255e870542dfd250255 (diff) | |
download | hittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.tar.gz hittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.tar.xz hittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.zip |
accesslog: clean up, rename buf to logtimestamp
-rw-r--r-- | hittpd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hittpd.c b/hittpd.c index 77fcda3..c08b129 100644 --- a/hittpd.c +++ b/hittpd.c @@ -257,14 +257,15 @@ accesslog(http_parser *p, int status) struct conn_data *data = p->data; - char buf[64]; - strftime(buf, 64, "[%d/%b/%Y:%H:%M:%S %z]", localtime(&now)); + char logtimestamp[64]; + strftime(logtimestamp, sizeof logtimestamp, + "[%d/%b/%Y:%H:%M:%S %z]", localtime(&now)); // REMOTEHOST - - [DD/MON/YYYY:HH:MM:SS -TZ] "METHOD PATH" STATUS BYTES // ? REFERER USER_AGENT printf("%s - - %s \"%s ", peername(data->fd), - buf, + logtimestamp, http_method_str(p->method)); for (char *s = data->path; *s; s++) |