From 4ef635e9a8f8e2e631082dd1cf597200fc574171 Mon Sep 17 00:00:00 2001 From: Sebastian Benoit Date: Mon, 3 Aug 2020 11:05:25 +0000 Subject: remove unused functions from Ross L Richardson , Thanks ok claudio@ --- usr.sbin/httpd/httpd.c | 62 +------------------------------------------------- usr.sbin/httpd/httpd.h | 5 +--- 2 files changed, 2 insertions(+), 65 deletions(-) (limited to 'usr.sbin') 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 @@ -1058,50 +1058,6 @@ kv_free(struct kv *kv) memset(kv, 0, sizeof(*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) { @@ -1273,22 +1229,6 @@ print_host(struct sockaddr_storage *ss, char *buf, size_t len) return (buf); } -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) { 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 @@ -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 *); -- cgit v1.2.3