diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-03-06 15:11:35 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-03-06 15:11:59 +0100 |
commit | ca029d0d8afa8f77905fc4d73d5cde66509f9f58 (patch) | |
tree | 8c8a10ee9e0438e9a60e06aa5c269aa2ac305079 | |
parent | d6528ee16f7c8926c8185d7ae01a0f86bffb7eab (diff) | |
download | gnutls-ca029d0d8afa8f77905fc4d73d5cde66509f9f58.tar.gz |
gnutls-cli-debug: do not warn multiple times about unknown protocols
-rw-r--r-- | src/socket.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c index 262c91dcd4..f662c558e2 100644 --- a/src/socket.c +++ b/src/socket.c @@ -37,6 +37,7 @@ #include <signal.h> #endif #include <socket.h> +#include <c-ctype.h> #include "sockets.h" #ifdef HAVE_LIBIDN @@ -197,8 +198,13 @@ socket_starttls(socket_st * socket, const char *app_proto) send_line(socket->fd, "a STARTTLS\r\n"); wait_for_text(socket->fd, "a OK", 4); } else { - if (socket->verbose) - fprintf(stderr, "unknown protocol %s\n", app_proto); + if (socket->verbose && !c_isdigit(app_proto[0])) { + static int warned = 0; + if (warned == 0) { + fprintf(stderr, "unknown protocol %s\n", app_proto); + warned = 1; + } + } } return; |