chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] http/spiffy issues on Windows/MSVC


From: Graham Fawcett
Subject: [Chicken-users] http/spiffy issues on Windows/MSVC
Date: Fri, 12 May 2006 13:22:08 -0400

Felix, I'm copying the list on this reply; I'm hoping someone on the
list can reproduce my results.

On 5/11/06, felix winkelmann <address@hidden> wrote:
Did you get spiffy to run properly on Win32? I had
strange hangups when accessing large data (i,.e. images)
over the web-server. Does this work for you?

Caution: everything I've tested here was on a new machine, with a new
build of Chicken. It looks solid, but it's not impossible that my
errors are specific to my build.

Large images appear to work okay; at least I haven't seen any trouble
yet. But what is definitely not working is keep-alive. The entire
process is blocking upon the second read on the open connection.
(Note, this is an http-server problem, not a spiffy problem; I can
reproduce the same issues without spiffy.)

Here's a fixed version of the last test I sent you (lambda included this time!):

(use spiffy)
(use srfi-18)

(thread-start!
(make-thread (lambda ()
               (let loop ()
                 (thread-sleep! 1)
                 (display "beat\n" (current-error-port))
                 (loop)))))

(start-server port: 8080 root: "." debug: #f)

The server starts, and begins to print "beat" every second. As soon as
I visit a URL with my browser, I get a correct response, and the
connection remains open. But the "beat" stops printing. (If I try to
open a second browser, that one blocks waiting for a response.) After
closing the browser -- and closing the connection -- the "beat"
resumes.

So, either threads are stalled when reading (perhaps you have some
critical section that's wonky on my MSVC build?), or the process is
blocking on network input. Or...?

I'm attaching a patch for http-server.scm that includes a new
parameter, (http:enable-keep-alive), default value #t, that can force
connections to always close after a response. Also, the patch tests
does

 (when (eq? (build-platform) 'msvc) (http:enable-keep-alive #f))

with a warning message printed to stderr.

It's a shame to loose keep-alive, but it's a working server. If we can
get to the root of the problem later, removing the msvc test is easy
to do.

Now that it's running a bit more correctly, I'll do some tests with
large files, etc. and see if any other issues turn up. Meanwhile, if
anyone has some unit-tests for networking, threading, etc., I'd be
happy to run them here and report the results.

Cheers,
Graham

Attachment: http-server-keep-alive.patch.txt
Description: Text document


reply via email to

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