summaryrefslogtreecommitdiff
path: root/contrib/unbound/smallapp/unbound-control.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2020-11-28 18:09:16 +0000
committerCy Schubert <cy@FreeBSD.org>2020-11-28 18:09:16 +0000
commit2f0116b4bf0637b99f27a2b5c2bc3e9dedd931cf (patch)
tree001ea9ecba2ab8a879b5ad83779271dcab9b01ce /contrib/unbound/smallapp/unbound-control.c
parent78fc4e72413bbbffd5963e953e33f1e374318c01 (diff)
downloadsrc-test2-2f0116b4bf0637b99f27a2b5c2bc3e9dedd931cf.tar.gz
src-test2-2f0116b4bf0637b99f27a2b5c2bc3e9dedd931cf.zip
Notes
Diffstat (limited to 'contrib/unbound/smallapp/unbound-control.c')
-rw-r--r--contrib/unbound/smallapp/unbound-control.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/contrib/unbound/smallapp/unbound-control.c b/contrib/unbound/smallapp/unbound-control.c
index ce5f0e04d4c5..3fe6068be560 100644
--- a/contrib/unbound/smallapp/unbound-control.c
+++ b/contrib/unbound/smallapp/unbound-control.c
@@ -278,6 +278,8 @@ static void print_mem(struct ub_shm_stat_info* shm_stat,
shm_stat->mem.dnscrypt_nonce);
#endif
PR_LL("mem.streamwait", s->svr.mem_stream_wait);
+ PR_LL("mem.http.query_buffer", s->svr.mem_http2_query_buffer);
+ PR_LL("mem.http.response_buffer", s->svr.mem_http2_response_buffer);
}
/** print histogram */
@@ -342,6 +344,7 @@ static void print_extended(struct ub_stats_info* s)
PR_UL("num.query.tls", s->svr.qtls);
PR_UL("num.query.tls_resume", s->svr.qtls_resume);
PR_UL("num.query.ipv6", s->svr.qipv6);
+ PR_UL("num.query.https", s->svr.qhttps);
/* flags */
PR_UL("num.query.flags.QR", s->svr.qbit_QR);
@@ -593,11 +596,7 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd)
addrfamily = addr_is_ip6(&addr, addrlen)?PF_INET6:PF_INET;
fd = socket(addrfamily, SOCK_STREAM, proto);
if(fd == -1) {
-#ifndef USE_WINSOCK
- fatal_exit("socket: %s", strerror(errno));
-#else
- fatal_exit("socket: %s", wsa_strerror(WSAGetLastError()));
-#endif
+ fatal_exit("socket: %s", sock_strerror(errno));
}
if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) {
#ifndef USE_WINSOCK
@@ -681,11 +680,7 @@ remote_read(SSL* ssl, int fd, char* buf, size_t len)
/* EOF */
return 0;
}
-#ifndef USE_WINSOCK
- fatal_exit("could not recv: %s", strerror(errno));
-#else
- fatal_exit("could not recv: %s", wsa_strerror(WSAGetLastError()));
-#endif
+ fatal_exit("could not recv: %s", sock_strerror(errno));
}
buf[rr] = 0;
}
@@ -701,11 +696,7 @@ remote_write(SSL* ssl, int fd, const char* buf, size_t len)
ssl_err("could not SSL_write");
} else {
if(send(fd, buf, len, 0) < (ssize_t)len) {
-#ifndef USE_WINSOCK
- fatal_exit("could not send: %s", strerror(errno));
-#else
- fatal_exit("could not send: %s", wsa_strerror(WSAGetLastError()));
-#endif
+ fatal_exit("could not send: %s", sock_strerror(errno));
}
}
}
@@ -824,11 +815,7 @@ go(const char* cfgfile, char* svr, int quiet, int argc, char* argv[])
ret = go_cmd(ssl, fd, quiet, argc, argv);
if(ssl) SSL_free(ssl);
-#ifndef USE_WINSOCK
- close(fd);
-#else
- closesocket(fd);
-#endif
+ sock_close(fd);
if(ctx) SSL_CTX_free(ctx);
config_delete(cfg);
return ret;
@@ -886,7 +873,7 @@ int main(int argc, char* argv[])
if(argc == 0)
usage();
if(argc >= 1 && strcmp(argv[0], "start")==0) {
-#if defined(TARGET_OS_TV) || defined(TARGET_OS_WATCH)
+#if (defined(TARGET_OS_TV) && TARGET_OS_TV) || (defined(TARGET_OS_WATCH) && TARGET_OS_WATCH)
fatal_exit("could not exec unbound: %s",
strerror(ENOSYS));
#else