Re: ..on SOCKS5 support

Thomas Dickey <[email protected]>
Newsgroups gmane.comp.web.lynx.devel
Message-ID <20190916081954.2sjyu5ughqrxqti7@prl-debianold-64.jexium-island.net>
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 <[email protected]>
https://invisible-island.net
ftp://ftp.invisible-island.net

_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQTFIEjAwHSP7iJ9R6JwI1Pg9+SO2wUCXX9FqgAKCRBwI1Pg9+SO
29TSAJ918TE8pMHoHpSFH6dw/wHMOcFYZACeO3KdBeHY5T5nrFwAQ2lp8EUHa9Q=
=441Z
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.