Comments (13)
Try now =]
from carrier.
Thanks for getting back so fast. :)
I get the same hang, but, now I dont get a response at all when it connects.
I used to get a result when doing this, now I just get "CARRIER::BODY" which is strange.
CL-USER> (as:with-event-loop ()
(bb:catcher
(bb:alet ((result (carrier:request "https://www.apple.com/" :return-body t)))
(format t "result: ~s" result))
(t (e) (format t "error: ~a" e))))
result: CARRIER::BODY
This still hangs :(
CL-USER> (as:with-event-loop ()
(bb:catcher
(bb:alet ((result (carrier:request "https://www.apple.com:999/" :return-body t)))
(format t "result: ~s" result))
(t (e) (format t "error: ~a" e))))
from carrier.
I will start to dig in and see if I can find out why "CARRIER:BODY" symbol is being returned vs the data it points to. I'll let you know if I find anything out. Let me know if I can help test anything.
from carrier.
Okay tracked it down a bit more:
This works and gives result:
CL-USER> (as:with-event-loop ()
(bb:catcher
(bb:alet ((result (bb:with-promise (res rej)
(let ((x 4))
(res x)))))
(format t "result: ~s" result))
(t (e) (format t "error: ~a" e))))
result: 4
This seems to give the symbol back instead of evuating it:
CL-USER> (as:with-event-loop ()
(bb:catcher
(bb:alet ((result (bb:with-promise (res rej)
(let ((x 4))
(res x x)))))
(format t "result: ~s" result))
(t (e) (format t "error: ~a" e))))
; in: CL-ASYNC:WITH-EVENT-LOOP ()
; (LET ((X 4))
; (RES X X))
;
; caught STYLE-WARNING:
; The variable X is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
result: X
from carrier.
Changing promise.lisp:L117 from
`(apply ,',resolve-fn ',args))))
To
`(funcall ,',resolve-fn ,@args))))
Seems to fix it, but not sure that is best way
from carrier.
I will make a pull request for the above in blackbird when I get a chance here shortly
from carrier.
okay pull request made orthecreedence/blackbird#18
from carrier.
This just fixes data being returned when it can connect. It doesnt fix the initial hanging issue. It still hangs when it cannot connect.
from carrier.
Thanks for the PR!
Thinking about it more, this may be a system issue. I think if you don't specify a timeout, some *nix systems will hold the connection open for quite a long time. Does setting :timeout 20
in the carrier:request
call help at all? Keep in mind this is a read timeout, so each time data is read the timeout is reset.
from carrier.
The issue seems to be when trying to connect to a host:port that isnt open, it just hangs carrier instead of erroring out with cannot connect.
from carrier.
Nick, are you still seeing this? With master cl-async/libuv/carrier I'm not seeing hangs in windows/ccl, linux/ccl, linux/sbcl at all. They eventually time out with an error (passed to the promise).
from carrier.
Yeah, it times out now for me too :)
Should it timeout or fail right away when a connection is refused?
from carrier.
I think there's some ambiguity as to whether the connection is refused or not. If you were to try it locally, it would probably say "connection refused" but with remote servers, a timeout is generally how it responds. I'm not really sure how TCP differentiates, TBH. I think it might be a function of the underlying OS.
from carrier.
Related Issues (19)
- When using chunked responses carrier returns only the first chunked response HOT 11
- ssl uri sometime work sometimes dont HOT 1
- errors with latest quicklisp HOT 5
- Unbound variable and function HOT 1
- Test against httpbin
- HTTP request returning nil HOT 4
- Parses urls incorrectly HOT 2
- Certain SSL sites don't work HOT 4
- Allow for streaming request body
- Doesnt handle query strings HOT 2
- Issue with `location` in response headers being a relative path
- Any reasons not to use this for AWS SDK? HOT 7
- Reusing SSL Context
- cookie support HOT 6
- ssl causes faults on sbcl HOT 20
- Multiple issues when using latest quicklisp and carrier master
- Multiple issues when using latest quicklisp and carrier master HOT 11
- Can we add this project to quicklisp? HOT 3
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 carrier.