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

2019-09-16 Thread Steffen Nurpmeso
Hello.

Steffen Nurpmeso wrote in <20190916201722.43jo6%stef...@sdaoden.eu>:
 |Steffen Nurpmeso wrote in <20190916181305._pau3%stef...@sdaoden.eu>:
 ||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%stef...@sdaoden.eu>:
 |||>|Steffen Nurpmeso wrote in <20190911141510.7s2dr%stef...@sdaoden.eu>:
 |||>||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 see we would also have crashed if the hostname length would have
 |been excessed.  Ah, it also was the last night of the proms, i am
 |sorry.  But i wanted to post it on Saturday, after having said
 |i will do it Wednesday or Thursday.  Other than that i hope it is
 |fine.

Now here stylified the way you did, with your jumps copied over
(but placed at end of function to pessimize errors), Thorsten's
htons() replacement, and style adjusted to what seems appropriate
for lynx.  I did not initialize all locals due to the reordering
of the first conditional (i would in fact rather use a struct to
collect all that, and do the SOCKS5 address lookup only once, as
the address is fixed in lynx; anyway).  Works here from a short
test.  I also added the word "to" to manual and help string.

--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)
diff -Napru -u lynx2.8.9rel.1.orig/lynx.man lynx2.8.9rel.1/lynx.man
--- lynx2.8.9rel.1.orig/lynx.man	2018-07-08 12:54:20.0 +0200
+++ lynx2.8.9rel.1/lynx.man	2019-09-16 22:27:31.540865464 +0200
@@ -804,6 +804,11 @@ If enabled the transfer rate is shown in
 If disabled, no transfer rate is shown.
 Use lynx.cfg or the options menu to select KB/second and/or ETA.
 .TP
+.B \-socks5-proxy=URL
+(Via which) SOCKS5 proxy to connect to.
+This controls the builtin SOCKS5 support, and is therefore unrelated to
+the option \fB\-nosocks\fP.
+.TP
 .B \-soft_dquotes
 toggles emulation of the old Netscape and Mosaic bug which
 treated \*(``>\*('' as a co-terminator for double-quotes and tags.
diff -Napru -u lynx2.8.9rel.1.orig/src/LYGlobalDefs.h lynx2.8.9rel.1/src/LYGlobalDefs.h
--- lynx2.8.9rel.1.orig/src/LYGlobalDefs.h	2018-03-28 01:05:13.0 +0200
+++ lynx2.8.9rel.1/src/LYGlobalDefs.h	2019-09-16 22:19:08.160874980 +0200
@@ -441,6 +441,7 @@ extern "C" {
 extern BOOLEAN debug_display_partial;	/* show with MessageSecs delay */
 extern BOOLEAN display_partial_flag;	/* permanent flag, not mutable */
 #endif
+extern char *socks5_proxy;
 extern char *form_post_data;	/* User data for post form */
 extern char *form_get_data;	/* User data for get form */
 extern char *http_error_file;	/* Place HTTP status code in this file */
diff -Napru -u lynx2.8.9rel.1.orig/src/LYMain.c lynx2.8.9rel.1/src/LYMain.c
--- lynx2.8.9rel.1.orig/src/LYMain.c	2018-07-08 17:22:44.0 +0200
+++ lynx2.8.9rel.1/src/LYMain.c	2019-09-16 22:27:23.827532277 +0200
@@ -635,6 +635,8 @@ BOOLEAN debug_display_partial = FALSE;	/
 int partial_threshold = -1;	/* # of lines to be d/l'ed until we repaint */
 #endif
 
+char *socks5_proxy = NULL;
+
 BOOLEAN LYNonRestartingSIGWINCH = FALSE;
 BOOLEAN LYReuseTempfiles = FALSE;
 BOOLEAN LYUseBuiltinSuffixes = TRUE;
@@ -3910,6 +3912,10 @@ saves session to that file on exit"
   "toggles display of transfer rate"
),
 #endif
+   PARSE_STR(
+  "socks5-proxy",	2|NEED_LYSTRING_ARG,	socks5_proxy,
+  "=URL\n(Via which) SOCKS5 proxy to connect to (unrelated to -nosocks!)"
+   ),
PARSE_SET(
   "soft_dquotes",	4|TOGGLE_ARG,		soft_dquotes,
   "toggles emulation of the old Netscape and Mosaic\n\
diff -Napru -u lynx2.8.9rel.1.orig/WWW/Library/Implementation/HTTCP.c lynx2.8.9rel.1/WWW/Library/Implementation/HTTCP.c
--- lynx2.8.9rel.1.orig/WWW/Library/Implementation/HTTCP.c	2018-05-16 21:48:49.0 +0200
+++ lynx2.8.9rel.1/WWW/Library/Implementation/HTTCP.c	2019-09-16 22:53:29.772696773 +0200
@@ -1825,10 +1825,16 @@ int HTDoConnect(const char *url,
 		int default_port,
 		int *s)
 {
-int status = 0;
+/* On error goto cleanup */
+char *socks5_host;
+unsigned socks5_host_len;
+int socks5_port;
+const char *socks5_orig_url;
+int status = HT_OK;
 char *line = NULL;
 char *p1 = NULL;
 char *host = NULL;
+char const *emsg;
 
 #ifdef INET6
 LYNX_ADDRINFO *res = 0, *res0 = 0;
@@ -1836,7 +1842,48 @@ int HTDoConnect(const char *url,
 #else
 struct sockaddr_in sock_A;
 struct sockaddr_in *soc_in = _A;
+#endif
+
+*s = -1;/* 

Re: [Lynx-dev] lynx fails to load page

2019-09-16 Thread Thorsten Glaser
David Woolley dixit:

> This appears to be a kernel mode failure.

> if speakup does

Yes, this is a crash in the speakup Linux kernel module.

bye,
//m

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


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

2019-09-16 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20190916181305._pau3%stef...@sdaoden.eu>:
 |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%stef...@sdaoden.eu>:
 ||>|Steffen Nurpmeso wrote in <20190911141510.7s2dr%stef...@sdaoden.eu>:
 ||>||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 see we would also have crashed if the hostname length would have
been excessed.  Ah, it also was the last night of the proms, i am
sorry.  But i wanted to post it on Saturday, after having said
i will do it Wednesday or Thursday.  Other than that i hope it is
fine.

Ciao,

--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
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


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

2019-09-16 Thread Steffen Nurpmeso
Mouse wrote in <201909161831.oaa09...@stone.rodents-montreal.org>:
 |> 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.
 |
 |I've similarly seen it said; specifically, I've read that some DSPs
 |have compilers where char, short, int, and long are all the same size,
 |32 bits, because that's the smallest unit the hardware works with.

Ah, ok.

 |I've never actually used such a compiler myself.  But then, I've never
 |used anything Cish on a DSP, so that means little.

I would be in favour of Thorsten's adjustment then nonetheless.
Better than having a silent point of failure somewhere.

--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
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


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

2019-09-16 Thread Mouse
> 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.

I've similarly seen it said; specifically, I've read that some DSPs
have compilers where char, short, int, and long are all the same size,
32 bits, because that's the smallest unit the hardware works with.

I've never actually used such a compiler myself.  But then, I've never
used anything Cish on a DSP, so that means little.

/~\ The ASCII Mouse
\ / Ribbon Campaign
 X  Against HTMLmo...@rodents-montreal.org
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


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

2019-09-16 Thread Steffen Nurpmeso
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%stef...@sdaoden.eu>:
 |>|Steffen Nurpmeso wrote in <20190911141510.7s2dr%stef...@sdaoden.eu>:
 |>||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 +, 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([i], (unsigned char *) , 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)

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] lynx fails to load page

2019-09-16 Thread David Woolley

On 16/09/2019 18:58, Jude DaShiell wrote:

http://ix.io/1TLJ


This appears to be a kernel mode failure.  Lynx doesn't run in kernel 
mode, and if speakup does, it should defend itself against user mode 
program errors.




This crashes when speakup-ng is running with lynx.  I haven't yet tried it
with other browsers.





___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


[Lynx-dev] lynx fails to load page

2019-09-16 Thread Jude DaShiell
http://ix.io/1TLJ

This crashes when speakup-ng is running with lynx.  I haven't yet tried it
with other browsers.


-- 


___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


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

2019-09-16 Thread Thomas Dickey
On Mon, Sep 16, 2019 at 01:16:48AM +, 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([i], (unsigned char *) , 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 
https://invisible-island.net
ftp://ftp.invisible-island.net


signature.asc
Description: PGP signature
___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev