-
Notifications
You must be signed in to change notification settings - Fork 14
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
DEBUG: Error: Message underflow. #3
Comments
A message underflow is thrown when the message ends but the last boundary hasn't been fully parsed, or been parsed at all. Either the integrity of the message was actually compromised when uploading, or zombie doesn't send the trailing "--", which is required by the specification for the last boundary. (It could also be the case that zombie is not sending a final boundary key at all). Something could be wrong with the multipart parser, but since the bug occurred in both formidable and parted (and they gave the same exact kind of error), I'm guessing it has something to do with zombie. I wouldn't want to fix this for the sake of zombie because it's actually a very important integrity check. |
If you could show me a gist of the exact multipart message (headers included) that zombie is producing, I might be able to see if something is wrong. The raw output would be good, minus the binary data. |
THANK-YOU-SO-MUCH! I think I'll find way to go. Regard for integrity thing, I totally agree with you. Now it's time to dissect corps. |
I found zombie said server bigger header["content-length"] than actual body size due to including boundary texts and so on.
Here's a output of request.toString() of zombie.
As you see, this request doesn't include file data, tough a form has a file field and "enctype='multipart/form-data'". Any wild guesses? |
I can't see anything wrong with it. It looks fine unless it's doing something like using just line feeds instead of CRLF. I can't tell if it is or not because github probably normalizes them. The problem might lie in the headers, not the headers for each part, but the raw header for the entire message. Taking a look at them without getting parsed as JSON might help. |
I've also been looking at the code for zombie's multipart submission: https://github.com/assaf/zombie/blob/master/src/zombie/resources.coffee From what I can tell right now, the code seems to be correct. I'll have to mess around with zombie a bit to figure it out. |
Thanks again, chjj. Actually in resources.coffee, line.220 bloats header['content-length'] unnecessary. And about row headers, I couldn't catch it in javascript . Regards. |
I managed to get raw post data.
I noticed that "Connection: close\r\n" was sent after cookie. |
Maybe it's a problem with the http client closing the connection to soon? If no agent is used, connection:close is set and node calls Or, instead of using parted, just look at the raw data recieved by the server, and see if it is complete? It would make sense if the socket was getting prematurely closed for some strange reason, as both parted and formidable are saying it is. |
Hi, chjj. I could circumvent a "Message underflow" error and uploaded a file by not sending headers['content-length']. And I also noticed zombie against a php file upload script yielded the same result. I'm going to post this new problem on zombie repository. Thanks for your help. |
Zombie uses base64 for it's file uploads? Why? The parted multipart parser doesn't take into account base64'd files right now. Maybe I should implement it now that I see something actually uses it. I've never seen a browser use it though. There doesn't seem to be much reason to use it, as http can handle raw binary. Anyway, interesting, hope you get it sorted out. |
Hi, chjj. I managed to make zombie send binary files as binary. Here are what I could know as of now.
Now I'm thinking to abandon zombie and move to soda & selenium for functional testing. |
This may not be an issue of parted.
At first, I posted this problem at Zombie repository
But I am at a loss where to go.
So I'm here to seek help.
Here's a story.
I test my application (which is based on express) with zombie for functional tests.
When I tested file upload function, I got weird error.
I guessed zimbie had some bugs at this point.
But,
Hmm, zombie works well other servers.
Then I guessed any problems lurked somewhere in express.
I traced codes of express, and of course them of parted.
But I couldn't find anything.
Do you guys have any guesses?
I appreciate any clues.
Thanks.
The text was updated successfully, but these errors were encountered: