-
Notifications
You must be signed in to change notification settings - Fork 35
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 server seems to ignore incoming body (checked for POST) #7
Comments
Yeah the http server is very much half baked at this point. Everything is in place though, so parsing the body should be straightforward. Just for info: we're using async in production here, for all our internal networking needs. It's working really well, but pretty much as with a basic node.js server, there's no protection / robustness ensured at any level. Recently we added a async.pcall(), which catches any crash in a callback, and gives you a traceback that goes through the callback levels. That alone is pretty much enough to build crash-free services. Looking forward to your feedback / use cases for this. LibUV and the async model is really really exciting, it's been the backbone of everything we've built at Madbits, we just love it. |
I've actually traced through the code, and it seems like even though there is a body in the incoming request, lhttp_parser never calls the onBody function. I wasn't sure if it was a shortcoming of lhttp_parser or the handler in ASyNC itself. wdyt? |
That line never gets called? Not sure why, I've really never looked at it. I only use plain TCP connections most of the time, and a basic http server for a few things, but that's all. It would be great to get into this though. |
Yes it never gets called. Thanks. Might send in some patches for a better http client as well. |
Cool. If you're interested in this aync model, we've also started an async client for redis. Not really documented but very usable: here. Unfortunately persist can't really be built on top of an async client. We use that driver for our queuing system. |
i'm curious, why cant persist be used in an async client? (i know it might be blocking, but it can still be used right?) |
It can definitely be used, but it's blocking. If you're writing a server / process that needs to be available with low-latency, and you're doing a lot of redis lookups, it's better to have an async client for redis: this way the main event loop is literally never blocking... |
right! got it. |
The http server seems to never trigger the onBody function, even when given an incoming valid request.
For example:
POST HTTP/1.1
Host: localhost:8080
Cache-Control: no-cache
{"title":"Hello World!","body":"This is my first post!"}
The request.body field is just an empty table, and I see that onBody is not triggered.
The text was updated successfully, but these errors were encountered: