diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2020-08-03 11:05:25 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2020-08-03 11:05:25 +0000 |
commit | 4ef635e9a8f8e2e631082dd1cf597200fc574171 (patch) | |
tree | 1452b90d0b214ab1aa855fd472caa8c1e3e36778 | |
parent | 900b57ac688ab8d0c956f4b916be321eb4a60884 (diff) |
remove unused functions
from Ross L Richardson <openbsd AT rlr DOT id DOT au>, Thanks
ok claudio@
-rw-r--r-- | usr.sbin/httpd/httpd.c | 62 | ||||
-rw-r--r-- | usr.sbin/httpd/httpd.h | 5 |
2 files changed, 2 insertions, 65 deletions
diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c index af04f5c1a5b..0e3d7b52d98 100644 --- a/usr.sbin/httpd/httpd.c +++ b/usr.sbin/httpd/httpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.c,v 1.69 2020/07/30 21:06:19 benno Exp $ */ +/* $OpenBSD: httpd.c,v 1.70 2020/08/03 11:05:24 benno Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -1059,50 +1059,6 @@ kv_free(struct kv *kv) } struct kv * -kv_inherit(struct kv *dst, struct kv *src) -{ - memset(dst, 0, sizeof(*dst)); - memcpy(dst, src, sizeof(*dst)); - TAILQ_INIT(&dst->kv_children); - - if (src->kv_key != NULL) { - if ((dst->kv_key = strdup(src->kv_key)) == NULL) { - kv_free(dst); - return (NULL); - } - } - if (src->kv_value != NULL) { - if ((dst->kv_value = strdup(src->kv_value)) == NULL) { - kv_free(dst); - return (NULL); - } - } - - return (dst); -} - -int -kv_log(struct evbuffer *log, struct kv *kv) -{ - char *msg; - - if (log == NULL) - return (0); - if (asprintf(&msg, " [%s%s%s]", - kv->kv_key == NULL ? "(unknown)" : kv->kv_key, - kv->kv_value == NULL ? "" : ": ", - kv->kv_value == NULL ? "" : kv->kv_value) == -1) - return (-1); - if (evbuffer_add(log, msg, strlen(msg)) == -1) { - free(msg); - return (-1); - } - free(msg); - - return (0); -} - -struct kv * kv_find(struct kvtree *keys, struct kv *kv) { struct kv *match; @@ -1274,22 +1230,6 @@ print_host(struct sockaddr_storage *ss, char *buf, size_t len) } const char * -print_time(struct timeval *a, struct timeval *b, char *buf, size_t len) -{ - struct timeval tv; - unsigned long h, sec, min; - - timerclear(&tv); - timersub(a, b, &tv); - sec = tv.tv_sec % 60; - min = tv.tv_sec / 60 % 60; - h = tv.tv_sec / 60 / 60; - - snprintf(buf, len, "%.2lu:%.2lu:%.2lu", h, min, sec); - return (buf); -} - -const char * printb_flags(const uint32_t v, const char *bits) { static char buf[2][BUFSIZ]; diff --git a/usr.sbin/httpd/httpd.h b/usr.sbin/httpd/httpd.h index 94eca5977dc..12183f8cef0 100644 --- a/usr.sbin/httpd/httpd.h +++ b/usr.sbin/httpd/httpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.h,v 1.148 2020/07/30 21:06:19 benno Exp $ */ +/* $OpenBSD: httpd.h,v 1.149 2020/08/03 11:05:24 benno Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> @@ -731,8 +731,6 @@ void kv_delete(struct kvtree *, struct kv *); struct kv *kv_extend(struct kvtree *, struct kv *, char *); void kv_purge(struct kvtree *); void kv_free(struct kv *); -struct kv *kv_inherit(struct kv *, struct kv *); -int kv_log(struct evbuffer *, struct kv *); struct kv *kv_find(struct kvtree *, struct kv *); int kv_cmp(struct kv *, struct kv *); struct media_type @@ -751,7 +749,6 @@ struct auth *auth_add(struct serverauth *, struct auth *); struct auth *auth_byid(struct serverauth *, uint32_t); void auth_free(struct serverauth *, struct auth *); const char *print_host(struct sockaddr_storage *, char *, size_t); -const char *print_time(struct timeval *, struct timeval *, char *, size_t); const char *printb_flags(const uint32_t, const char *); void getmonotime(struct timeval *); |