aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/connecthostport.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-09-14 21:04:12 +0200
committerRiccardo Spagni <ric@spagni.net>2017-09-14 21:04:12 +0200
commit13a263894ae13460803d2f7fb1ec3efadaeb79d1 (patch)
tree42c42df9e482324d27d72d1b4c5ead405eaec0e9 /external/miniupnpc/connecthostport.c
parentMerge pull request #2438 (diff)
parentupdate miniupnpc (diff)
downloadmonero-13a263894ae13460803d2f7fb1ec3efadaeb79d1.tar.xz
Merge pull request #2378
b338dad2 update miniupnpc (MaxXor)
Diffstat (limited to 'external/miniupnpc/connecthostport.c')
-rw-r--r--external/miniupnpc/connecthostport.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/external/miniupnpc/connecthostport.c b/external/miniupnpc/connecthostport.c
index 1f2a032ee..d28aaf5e0 100644
--- a/external/miniupnpc/connecthostport.c
+++ b/external/miniupnpc/connecthostport.c
@@ -1,7 +1,7 @@
/* $Id: connecthostport.c,v 1.15 2015/10/09 16:26:19 nanard Exp $ */
/* Project : miniupnp
* Author : Thomas Bernard
- * Copyright (c) 2010-2015 Thomas Bernard
+ * Copyright (c) 2010-2017 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */
@@ -36,15 +36,13 @@
/* defining MINIUPNPC_IGNORE_EINTR enable the ignore of interruptions
* during the connect() call */
#define MINIUPNPC_IGNORE_EINTR
-#ifndef USE_GETHOSTBYNAME
#include <sys/socket.h>
#include <sys/select.h>
-#endif /* #ifndef USE_GETHOSTBYNAME */
#endif /* #else _WIN32 */
/* definition of PRINT_SOCKET_ERROR */
#ifdef _WIN32
-#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError());
+#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError());
#else
#define PRINT_SOCKET_ERROR(x) perror(x)
#endif
@@ -100,13 +98,13 @@ int connecthostport(const char * host, unsigned short port,
timeout.tv_usec = 0;
if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0)
{
- PRINT_SOCKET_ERROR("setsockopt");
+ PRINT_SOCKET_ERROR("setsockopt SO_RCVTIMEO");
}
timeout.tv_sec = 3;
timeout.tv_usec = 0;
if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval)) < 0)
{
- PRINT_SOCKET_ERROR("setsockopt");
+ PRINT_SOCKET_ERROR("setsockopt SO_SNDTIMEO");
}
#endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */
dest.sin_family = AF_INET;