lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] ..on SOCKS5 support


From: Thomas Dickey
Subject: Re: [Lynx-dev] ..on SOCKS5 support
Date: Mon, 16 Sep 2019 04:19:54 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Sep 16, 2019 at 01:16:48AM +0000, Thorsten Glaser wrote:
> Thomas Dickey dixit:
> 
> >well... I'll have to set up something for testing
> 
> ssh -D starts a SOCKS5 server on the SSH client side AIUI.

thanks (will see)
 
> >but here's something more like the style of lynx
> 
> Pleaseā€¦
> 
> -       /* C99 */  {
> -           unsigned short x;   /* XXX 16-bit? */
> -
> -           x = htons(socks5_port);
> -           memcpy(&pbuf[i], (unsigned char *) &x, sizeof x);
> -           i += (unsigned) sizeof(x);
> -       }
> +       pbuf[i++] = (((unsigned)socks5_port) >> 8) & 0xFF;
> +       pbuf[i++] = ((unsigned)socks5_port) & 0xFF;
> 
> (or just make socks5_port unsigned int, if you can)

I missed that (most of my attention was on the compiler warnings).
 
> This should even be optimisable by compilers.

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]