Subject: [clisp-list] broken http inspect server on win32

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Wed Apr 17 09:33:09 2002

Hi,

Sam Steingold wrote:
> missed this.  please try the patch:
>  local void low_close_socket (object stream, object handle) {
>    begin_system_call();
> + #ifdef WIN32_NATIVE
> +  if (shutdown(TheSocket(handle),SHUT_RDWR)) { SOCK_error(); }
> + #endif
>    if (!( closesocket(TheSocket(handle)) ==0)) { SOCK_error(); }
>    end_system_call();
>  }

The define is SD_BOTH (cf Arseny's e-mail), not SHUT_*.

It doesn't change observed behaviour. Still lots of connection reset by peer in Netscape.

Oddly enough, when I set (setq sys::*inspect-debug* 5), the inspector seems to (mostly) work. But when I don't (set to 0), I get (more often?) errors!?!
More precisely, I get an error from Netscape only at the end (quit link), while CLISP terminates the inspector server. Without debug at 5, I sometimes saw in Netscape the "you may now close this window" message that CLISP sends.

IE doesn't display anything...
CLISP debug output says
SYSTEM::HTTP-COMMAND: new socket: #<IO UNBUFFERED SOCKET-STREAM CHARACTER 0.0.0.0:4448>
SYSTEM::HTTP-COMMAND: new socket: #<IO UNBUFFERED SOCKET-STREAM CHARACTER 0.0.0.0:4448>
SYSTEM::HTTP-COMMAND: new socket: #<IO UNBUFFERED SOCKET-STREAM CHARACTER 0.0.0.0:4448>
SYSTEM::HTTP-COMMAND: new socket: #<IO UNBUFFERED SOCKET-STREAM CHARACTER 0.0.0.0:4448>
but nothing else.

BTW, years ago, there was a HTTP-based inspector which would allow to see many more of the CLISP internals. What happened?

Regards,
	Jorg Hohle.

---

From: Sam Steingold <[email-masked]>
Date: Mon Apr 22 08:57:03 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] broken http inspect server on win32"
> * Sent on Wed, 17 Apr 2002 18:32:29 +0200
> * Honorable "Hoehle, Joerg-Cyril" <[email-masked]> writes:
>
> Hi,
> 
> Sam Steingold wrote:

SHUT_* is the POSIX standard; I define them in win32.d.

please try the appended patch.
keep-alive was disabled since it requires computing the content-length
in characters which is hard to achieve due to CR/LF &c.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
<http://www.palestine-central.com/> <http://www.mideasttruth.com/>
Murphy's Law was probably named after the wrong guy.

--- inspect.lisp.~1.13.~	Wed Jan 16 17:32:49 2002
+++ inspect.lisp	Mon Apr 22 11:48:34 2002
@@ -559,6 +559,7 @@
         (when (> debug 0)
           (format t "~s: connection: ~s (keep-alive: ~s)~%"
                   'http-command (subseq line 12) keep-alive))
+        #+discard-keep-alive
         (when keep-alive
           (setq keep-alive nil)
           (when (> debug 0)