From f2854380220268ee5c8fe93c03dfa47b22e245c2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg <daniel@haxx.se> Date: Thu, 3 Jun 2010 13:55:54 +0200 Subject: [PATCH] direct_tcpip: bring back inclusion of libssh2_config.h In order to increase portability of this example, I'm bringing the inclusion of libssh2_config.h back, and I also added an require that header for this example to compile. I also made all code lines fit within 80 columns. --- example/direct_tcpip.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/example/direct_tcpip.c b/example/direct_tcpip.c index f7d81ce..c066042 100644 --- a/example/direct_tcpip.c +++ b/example/direct_tcpip.c @@ -1,3 +1,4 @@ +#include "libssh2_config.h" #include <libssh2.h> #ifdef WIN32 @@ -18,6 +19,10 @@ #include <unistd.h> #include <sys/types.h> +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif + #ifndef INADDR_NONE #define INADDR_NONE (in_addr_t)-1 #endif @@ -150,7 +155,8 @@ int main(int argc, char *argv[]) goto shutdown; } } else if (auth & AUTH_PUBLICKEY) { - if (libssh2_userauth_publickey_fromfile(session, username, keyfile1, keyfile2, password)) { + if (libssh2_userauth_publickey_fromfile(session, username, keyfile1, + keyfile2, password)) { printf("\tAuthentication by public key failed!\n"); goto shutdown; } @@ -197,8 +203,9 @@ int main(int argc, char *argv[]) channel = libssh2_channel_direct_tcpip_ex(session, remote_desthost, remote_destport, shost, sport); if (!channel) { - fprintf(stderr, "Could not open the direct-tcpip channel!\n"); - fprintf(stderr, "(Note that this can be a problem at the server! Please review the server logs.)\n"); + fprintf(stderr, "Could not open the direct-tcpip channel!\n" + "(Note that this can be a problem at the server!" + " Please review the server logs.)\n"); goto shutdown; }