Comments (3)
Currently this problem can be worked-around like this:
(let ((cl+ssl:*default-unwrap-stream-p* nil))
(time (nth-value 1 (dex:get "https://httpbin.org/delay/10" :read-timeout 2))))
After two seconds I have (on CCL):
A failure in the SSL library occurred on handle #<A Foreign Pointer #x7FE3400B2DF0> (return code: 1). ERR_print_errors(): 140614316242688:error:01000044:unknown library:unknown library:internal error:cl+ssl/src/bio.lisp:0:Unexpected SERIOUS-CONDITION in the Lisp BIO: Input timeout on #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4) #x3020027F4ACD>
[Condition of type CL+SSL::SSL-ERROR-SSL]
Backtrace:
0: (CL+SSL::SSL-SIGNAL-ERROR #<A Foreign Pointer #x7FE3400B2DF0> #<Compiled-function CL+SSL::SSL-READ #x30200180772F> 1 -1)
1: (#<STANDARD-METHOD STREAM-READ-BYTE (CL+SSL::SSL-STREAM)> #<SSL-STREAM for #<BASIC-TCP-STREAM :CLOSED #x3020027F4ACD>>)
2: (READ-BYTE #<SSL-STREAM for #<BASIC-TCP-STREAM :CLOSED #x3020027F4ACD>> NIL NIL)
3: (DEXADOR.BACKEND.USOCKET::READ-UNTIL-CRLF*2 #<SSL-STREAM for #<BASIC-TCP-STREAM :CLOSED #x3020027F4ACD>>)
4: (DEXADOR.BACKEND.USOCKET::READ-RESPONSE #<SSL-STREAM for #<BASIC-TCP-STREAM :CLOSED #x3020027F4ACD>> T NIL T)
5: (DEXADOR.BACKEND.USOCKET:REQUEST "https://httpbin.org/delay/10" :METHOD :GET :READ-TIMEOUT 2)
6: (#<Anonymous Function #x3020027F93FF>)
7: (CCL::REPORT-TIME (NTH-VALUE 1 (DEXADOR:GET "https://httpbin.org/delay/10" :READ-TIMEOUT 2)) #<Anonymous Function #x3020027F93FF>)
This works because the *default-unwrap-stream-p* nil
makes cl+ssl delegate all the low-level (unencrypted) IO to the lisp stream of the socket - cl+ssl uses custom Lisp BIO in this case. And the Lisp stream has timeout configured by dexador.
In the default mode cl+ssl extracts socket file descriptor from lisp stream, and passes it to OpenSSL to perform IO using the normal OpenSSL's socket BIO. And the socket file descriptor does not know about the timeout set on the Lisp stream level.
from dexador.
If it can be of help, same test on LispWorks (Windows) times out after about 3.5 seconds:
CL-USER 9 > (time (nth-value 1 (dex:get "https://httpbin.org/delay/10" :read-timeout 2)))
Timing the evaluation of (NTH-VALUE 1 (DEXADOR:GET "https://httpbin.org/delay/10" :READ-TIMEOUT 2))
Error: ERROR 12002: Timeout
1 (abort) Return to top loop level 0.
Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.
CL-USER 10 : 1 >
User time = 0.000
System time = 0.000
Elapsed time = 3.838
Allocation = 140008 bytes
0 Page faults
from dexador.
I will work on correcting the implementation of this in cl+ssl. Then if I am still happy, will add to dexador and drakma.
from dexador.
Related Issues (20)
- Connection-pool nil problem when using master HOT 6
- Allow content for dex:delete HOT 2
- There is no character with name "NUL" HOT 3
- ERROR 12002: Timeout [Condition of type WINHTTP::WIN-ERROR]
- dex:fetch leaves files open HOT 6
- Potential issue with failing to close connections HOT 12
- The condition #<CHUNGA:INPUT-CHUNKING-UNEXPECTED-END-OF-FILE 4060090DA0> occurred HOT 4
- Is there a problem with the `dex:post` with an s-expression data on the body? HOT 2
- `ignore-and-continue` on `http-request-fail` HOT 3
- Failing when requesting localhost HOT 15
- Dex not restarting with SSL errors.
- Automatic URL parameter encoding for Content-Type: application/x-www-form-urlencoded breaks old code HOT 4
- Calling DEX::MAYBE-CLOSE with optional "close-if T" argument causes a CCL::BAD-SLOT-TYPE HOT 4
- Windows: Content-Type is replaced with "text/plain" when `:content` is present HOT 3
- Dexador started automatically retry bad requests, but previosly didn't HOT 3
- Keep alive stream prematurely EOFs HOT 3
- Retry on typical errors solution
- Specifying content types for parts of a post request HOT 1
- Name Conflict HOT 5
- Copying from KEEP-ALIVE-STREAM: The value NIL is not of type STREAM HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexador.