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

http-request http://lisp.org example triggers socket error (A non-blocking socket operation could not be completed immediately.) #139

Open
kensan73 opened this issue Oct 9, 2023 · 3 comments

Comments

@kensan73
Copy link

kensan73 commented Oct 9, 2023

Hello,

Total common lisp newbie here.

On Windows 11, portacle using sbcl I do

(ql:quickload :drakma)
(setf drakma:*header-stream* *standard-output*)
(drakma:http-request "http://lisp.org/")

and I see

image

I'm sure I'm doing something wrong, thanks for any help!

@avodonosov
Copy link
Contributor

avodonosov commented Oct 30, 2023

Works for me on linux and SBCL 2.2.9:

CL-USER> (ql:quickload :drakma)
(setf drakma:*header-stream* *standard-output*)
To load "drakma":
  Load 1 ASDF system:
    drakma
; Loading "drakma"
..................................................
[package puri]....................................
[package chipz]...................................
[package drakma]........
#<SYNONYM-STREAM :SYMBOL SWANK::*CURRENT-STANDARD-OUTPUT* {1001040153}>



CL-USER> (drakma:http-request "http://lisp.org/")
GET / HTTP/1.1
Host: lisp.org
User-Agent: Drakma/2.0.9 (SBCL 2.2.9; Linux; 5.15.0-87-generic; http://weitz.de/drakma/)
Accept: */*
Connection: close

HTTP/1.1 308 Permanent Redirect
Date: Mon, 30 Oct 2023 21:59:04 GMT
Content-Type: text/html
Content-Length: 164
Connection: close
Location: https://lisp.org

"<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>
"
308
((:DATE . "Mon, 30 Oct 2023 21:59:04 GMT") (:CONTENT-TYPE . "text/html")
 (:CONTENT-LENGTH . "164") (:CONNECTION . "close")
 (:LOCATION . "https://lisp.org"))
#<PURI:URI http://lisp.org/>
#<FLEXI-STREAMS:FLEXI-IO-STREAM {1004E84A83}>
T
"Permanent Redirect"

@kensan73
Copy link
Author

Worked for me on MacOS!
image

@3b
Copy link

3b commented Jun 28, 2024

seems to be usocket/usocket#106, which has a workaround in the code, but I think the workaround only worked if trivial-features got loaded first. Should work more reliably with current usocket.

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

3 participants