]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/connection.c
Update copyright year.
[tlsproxy/tlsproxy.git] / src / connection.c
index 793e4680ebfc6c9312498298a6a4737e5513f2a8..184ee5a4231a302ee520dfecb05b845cdde0e4bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Handle connections.
  *
- * Copyright (C) 2011-2013  Simon Ruderich
+ * Copyright (C) 2011-2014  Simon Ruderich
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
 #include <limits.h>
 #include <netdb.h>
 #include <poll.h>
+#include <sys/socket.h>
 #include <unistd.h>
 
 #include <gnutls/x509.h>
@@ -206,7 +207,7 @@ void handle_connection(int client_socket) {
     LOG(DEBUG1, "connection to server established");
 
     /* If the -u option is used and we don't know this hostname's server
-     * certificate then just pass through the connection and let the client
+     * certificate, then just pass through the connection and let the client
      * verify the server certificate. */
     if (global_passthrough_unknown) {
         char path[TLSPROXY_MAX_PATH_LENGTH];
@@ -843,7 +844,9 @@ static int connect_to_host(const char *hostname, const char *port) {
     gai_hints.ai_socktype = SOCK_STREAM;
     gai_hints.ai_protocol = 0;
     gai_hints.ai_flags    = AI_NUMERICSERV /* given port is numeric */
+#ifdef AI_ADDRCONFIG
                           | AI_ADDRCONFIG  /* supported by this computer */
+#endif
                           ;
     gai_return = getaddrinfo(hostname, port, &gai_hints, &gai_result);
     if (gai_return != 0) {