Re: ..on SOCKS5 support

Steffen Nurpmeso <[email protected]>
Newsgroups gmane.comp.web.lynx.devel
Message-ID <20190916181305._PAu3%[email protected]>
Hello.

Thomas Dickey wrote in <20190916003351.7x3j6ubnoerj7ysh@prl-debianold-64\
.jexium-island.net>:
 |On Sun, Sep 15, 2019 at 12:31:17AM +0200, Steffen Nurpmeso wrote:
 |> Steffen Nurpmeso wrote in <20190914220418.j7nb7%[email protected]>:
 |>|Steffen Nurpmeso wrote in <20190911141510.7s2dR%[email protected]>:
 |>||please excuse the late reply.
 |>  ...
 |>|Right.  So here is a working patch, porting over my own SOCKS5
 |> 
 |> Yep, but it should set status to an error code if the hostname
 |> length check in the upper conditional fails.  Sorry.
 |
 |well... I'll have to set up something for testing, but here's something
 |more like the style of lynx
 |
 |(I'll have to think about the ifdef's, but testing the proposed changes
 |would be next, before applying to trunk)

Uuh, i see RCS branch numbers :)  Well, i used "et ts=4 sts=4
sw=4", in the function was a mix of et/noet, and i only touched
the lines i had to, mostly.  Other than that i had a teacher in
about 1993 who tried to beat me to Pascal, sth. like "gotos are
evil", no, more like "Pascal is a language which does not have
goto", with a positive undertone (!!!!), and that to me coming
from basic.  No.  I was terribly wrong there.
I try to give it a shot tomorrow, but from having a look i became
confused, even though jumps there are nonetheless. ^_^

 ...
 --End of <[email protected]\
 .net>

Thomas Dickey wrote in <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).

Ah yes, that was one more thing i was unsure about, lynx does not
offer "bit-ed" type.  htons() is used somewhere else in the code.
I have never encountered a system where short is longer than
16-bit, therefore i have used short.  Well, i seem to recall
i might have heard of a system where short=int=32-bit, but this
could be false memory or whatever.

 |> This should even be optimisable by compilers.

My fault, i simply took my code, looked for htons via git grep,
and kept it in, even after not finding any true 16-bit type.
I am all in favour of using Thorsten's neutral version.

 ...
 --End of <[email protected]\
 .net>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev
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.