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: Steffen Nurpmeso
Subject: Re: [Lynx-dev] ..on SOCKS5 support
Date: Mon, 16 Sep 2019 20:13:05 +0200
User-agent: s-nail v14.9.15-68-gca06cb5f

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 <address@hidden>:
 |>|Steffen Nurpmeso wrote in <address@hidden>:
 |>||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 <20190916003351.7x3j6ubnoerj7ysh@prl-debianold-64.jexium-island\
 .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 <20190916081954.2sjyu5ughqrxqti7@prl-debianold-64.jexium-island\
 .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)



reply via email to

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