Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clack does not start hunchentoot on lispworks 7 #125

Open
andrely opened this issue Sep 19, 2015 · 5 comments
Open

Clack does not start hunchentoot on lispworks 7 #125

andrely opened this issue Sep 19, 2015 · 5 comments

Comments

@andrely
Copy link

andrely commented Sep 19, 2015

Ayup, Clack appears to stop the hunchentoot acceptor immediately when running under Lispworks (tested this with version 7).

It looks to me that the problem is in src/handler/hunchentoot.lisp lines 96-98. According to http://weitz.de/hunchentoot/#acceptors accept-connections() returns immediately on Lispworks rather than blocking and falls through to hunchentoot:stop().

Replacing:

  (unwind-protect
       (accept-connections acceptor)
    (hunchentoot:stop acceptor))

With:

  #-lispworks
  (unwind-protect
       (accept-connections acceptor)
    (hunchentoot:stop acceptor))
  #+lispworks
  (accept-connections acceptor)

Gets the acceptor (and caveman2 app) up and running but I think there's a bit more to making this work than this. At least stopping the app does not work properly.

I'm new to this framework, but I'll see if I can make a working path for you.

Kind regards

André Lynum

@andrely andrely changed the title Clack does not start hunchentoot on lipspworks 7 Clack does not start hunchentoot on lispworks 7 Sep 19, 2015
@Disclosure
Copy link

I can confirm that the issue is present on LispWorks 6.1.1 as well.

@Disclosure
Copy link

  #-lispworks
  (unwind-protect
       (accept-connections acceptor)
   (hunchentoot:stop acceptor))
   #+lispworks
   (accept-connections acceptor)

This solution does not appear to work in 6.1.1:

CL-USER 11 > (clack:clackup
  (lambda (env)
    (declare (ignore env))
    '(200 (:content-type "text/plain") ("Hello, Clack!"))))
Hunchentoot server is started.
Listening on localhost:5000.
#S(CLACK.HANDLER::HANDLER :SERVER :HUNCHENTOOT :ACCEPTOR #<MP:PROCESS Name "clack-handler-hunchentoot" Priority 0 State "Running">)

CL-USER 12 > *
#S(CLACK.HANDLER::HANDLER :SERVER :HUNCHENTOOT :ACCEPTOR #<MP:PROCESS Name "clack-handler-hunchentoot" Priority 0 State "Dead">)

@fukamachi
Copy link
Owner

I don't have the license of LispWorks, so I'm not willing to make my products work with it.

Send me as a pull request if it works for you.
I'll merge it since it doesn't break other implementations.

@yogavidya
Copy link

In src/handler/hunchentoot.lisp, line 73, substituting

  (let ((flex:*substitution-char* #-abcl #\Replacement_Character
                                  #+abcl #\?)
        (*client-socket* socket))
    (call-next-method)))

with

  (let ((flex:*substitution-char* #-(or abcl lispworks) #\Replacement_Character
                                  #+lispworks nil
                                  #+abcl #\?)
        (*client-socket* socket))
    (call-next-method)))

solved the problem for me on Lispworks Professional 6.1.1. I don't know about LW 7, it'd be nice if somebody could verify.

@manuel
Copy link
Contributor

manuel commented Feb 26, 2018

@yogavidya I can confirm that this works in LW 7.1 64bit OS X.

Update: this solved the problem of an error being signaled on startup, but not the issue of immediately quitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants