11 Commits

Author SHA1 Message Date
Daniel Stenberg
f285438022 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.
2010-06-03 13:55:54 +02:00
Simon Josefsson
7301036421 Eat our own dog food, call libssh2_init and libssh2_exit in the examples. 2010-03-19 09:35:00 +01:00
Dave McCaldon
ea914c8b72 Resolve compile issues on Solaris x64 and UltraSPARC
Solaris builds of libssh2-1.2.3 failed on both x64 and UltraSPARC
platforms because of two problems:

1) src/agent.c:145 sun is a reserved word when using the SUNWspro compiler
2) example/direct_tcpip.c:84 INADDR_NONE is not defined
2010-02-09 11:19:52 +01:00
Peter Stuge
68a900d27a Detect when the forwarded connection is closed in example/direct_tcpip.c 2010-01-30 00:45:56 +01:00
Peter Stuge
e4b7baa885 Fix example/direct_tcpip.c to work also on WIN32
read() and write() are no good for WIN32 sockets, use recv() and send().
2010-01-30 00:35:05 +01:00
Peter Stuge
d3dbe4c81e Simplify WIN32 ifdefs in example/direct_tcpip.c to allow standalone compile 2010-01-30 00:01:51 +01:00
Peter Stuge
6df87e64b7 Use LIBSSH2_HOSTKEY_HASH_SHA1 instead of _MD5 in examples and tests
MD5 support is optional and may not always be available, while SHA1 is both
required and recommended.
2010-01-29 23:06:31 +01:00
Peter Stuge
6c543545fe Make example/direct_tcpip.c compile for win32
One warning from FD_SET() remains, it is also in some other examples.
2010-01-29 20:35:24 +01:00
Daniel Stenberg
e3d8c1cfed generate a libssh2_config.h in the example dir
buildconf copies the template to example/ and configure makes sure
to generate a proper file from it and the direct_tcpip.c example
is the first one to use it - to make sure it builds fine on more
paltforms
2010-01-13 13:46:56 +01:00
Simon Josefsson
11a114ee7c Remove redundant #includes and reorder sys/types.h include. 2010-01-13 11:03:26 +01:00
Peter Stuge
bd0505d6b9 Add a direct-tcpip example which shows local port forwarding 2009-12-24 02:18:39 +01:00