Subject: Re: win32 tunneling

Re: win32 tunneling

From: Roman Kubiak <kubiak.roman_at_gmail.com>
Date: Fri, 15 May 2009 00:46:12 +0200

Well i got it working, the data is beeing passed but i got two problems

1. i can't enable debug with libssh2, what is the proper way to do
that apart from setting
#define LIBSSH2DEBUG
(dunno where to set it properly, i tried a few places)
and adding the debug callback

2. i can't detect EOF on the channel on win32, it never returns true,
i connect one tunnel end to SQUID, perhaps
  there is something wrong there, i mean the proxy doesn't close the
connection, perhaps it's a matter of headers
or something (just thinking out loud here)

ps.
i think you need to look at gettimeofday() in misc.c win32 doesn't
have that i wrote a small replacement:

int gettimeofday(struct timeval *tp, void *tzp)
{
#ifdef WIN32

    struct _timeb timebuffer;

    _ftime(&timebuffer);
    tp->tv_sec = timebuffer.time;
    tp->tv_usec = timebuffer.millitm * 1000;

    return 0;

#else

    tp->tv_sec = time(NULL);
    tp->tv_usec = 0;

    return 0;

#endif
}

-------------------------------
  Voltage Controlled
-------------------------------

On Wed, May 13, 2009 at 11:31 PM, Peter Stuge <peter_at_stuge.se> wrote:
> To conclude the discussion on IRC:
>
> Roman Kubiak wrote:
>> 6. for each new connection on my server socket i start a dataPipe,
>> that has the connected client socket and the sshChannel, and a new ID
>> (for streams, in the ssh channel)
>
> This is a problem, each forwarded TCP connection requires a channel
> of it's own. For local forwards, the channel type should be
> "direct-tcpip" and libssh2 takes care of that when using
> libssh2_channel_direct_tcpip_ex().
>
>
>> 7. all data comming from the socket are passed to the channel, and
>> all data from the channel to the socket, i use ssh2_poll
>
> As Daniel mentioned, better use plain select() because libssh2_poll()
> is deprecated.
>
>
> //Peter
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> libssh2-devel mailing list
> libssh2-devel_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libssh2-devel
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-05-15