-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Replace C HTTP parser with JS HTTP parser #1457
Commits on Jun 21, 2015
-
Configuration menu - View commit details
-
Copy full SHA for fc2378f - Browse repository at this point
Copy the full SHA fc2378fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 67b0e62 - Browse repository at this point
Copy the full SHA 67b0e62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b0ead3 - Browse repository at this point
Copy the full SHA 6b0ead3View commit details -
http: improve parser performance
* Relax header value and status reason parsing * Avoid using RegExp for folded line detection * Use faster: string trimming, case-insensitive string comparing, CRLF searching, and case-insensitive header value searching
Configuration menu - View commit details
-
Copy full SHA for 9dd9560 - Browse repository at this point
Copy the full SHA 9dd9560View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb3d679 - Browse repository at this point
Copy the full SHA eb3d679View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e37fcc - Browse repository at this point
Copy the full SHA 4e37fccView commit details -
http: fix max chunk size string len
Anything more than 14 hex characters definitely has a larger value than our max chunk size.
Configuration menu - View commit details
-
Copy full SHA for fd6c127 - Browse repository at this point
Copy the full SHA fd6c127View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a1e157 - Browse repository at this point
Copy the full SHA 6a1e157View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e63483 - Browse repository at this point
Copy the full SHA 2e63483View commit details -
benchmark: fix V8 warmup for http parser benchmarks
I think it's more accurate to "warm up" the one parser instance instead of creating many new throw-away instances since instances are typically reused in core.
Configuration menu - View commit details
-
Copy full SHA for 1ead648 - Browse repository at this point
Copy the full SHA 1ead648View commit details -
Configuration menu - View commit details
-
Copy full SHA for b254753 - Browse repository at this point
Copy the full SHA b254753View commit details -
benchmark: improve http parser benchmark more
This increases the loop count for the timed region and removes a couple of unlikely inputs.
Configuration menu - View commit details
-
Copy full SHA for 2c4ebc2 - Browse repository at this point
Copy the full SHA 2c4ebc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5ba8cf - Browse repository at this point
Copy the full SHA f5ba8cfView commit details -
http: remove chunk size string length checking
This was initially designed to verify we didn't have more digits than JavaScript can handle, but it's erroneously reporting errors when there are chunk extensions on the same line. The check's usefulness is semi-questionable anyway, so let's remove it for now.
Configuration menu - View commit details
-
Copy full SHA for f4d786e - Browse repository at this point
Copy the full SHA f4d786eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 455ea89 - Browse repository at this point
Copy the full SHA 455ea89View commit details -
http: allow double quotes and non-ASCII bytes in request URI
As the comments explain, these are not technically allowed, but since joyent/http-parser previously allowed them, we support them for better backwards compatibility.
Configuration menu - View commit details
-
Copy full SHA for 237e8d5 - Browse repository at this point
Copy the full SHA 237e8d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48e1dc7 - Browse repository at this point
Copy the full SHA 48e1dc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ade4029 - Browse repository at this point
Copy the full SHA ade4029View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3b4976 - Browse repository at this point
Copy the full SHA d3b4976View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ee84a8 - Browse repository at this point
Copy the full SHA 6ee84a8View commit details -
http: fix whitespace preservation if folding is encountered
Addtitionally this re-checks special headers in case the values we check for were on folded lines.
Configuration menu - View commit details
-
Copy full SHA for 766c731 - Browse repository at this point
Copy the full SHA 766c731View commit details -
Configuration menu - View commit details
-
Copy full SHA for 234864a - Browse repository at this point
Copy the full SHA 234864aView commit details -
This should now directly reflect how joyent/http-parser does keepalive checking.
Configuration menu - View commit details
-
Copy full SHA for b59f4f1 - Browse repository at this point
Copy the full SHA b59f4f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for a332c74 - Browse repository at this point
Copy the full SHA a332c74View commit details -
http: ensure first byte is printable ASCII
This helps detect bad input early to prevent a "hung" state where the parser keeps looking for a CRLF. Generally this shouldn't be an issue, but could happen if TLS handshaking data is mistakenly written to the parser for example.
Configuration menu - View commit details
-
Copy full SHA for 9a7f8d5 - Browse repository at this point
Copy the full SHA 9a7f8d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac584b9 - Browse repository at this point
Copy the full SHA ac584b9View commit details -
Typically the functions that return Error objects already have set the internal error state, so there is no need to do it twice.
Configuration menu - View commit details
-
Copy full SHA for 382b12c - Browse repository at this point
Copy the full SHA 382b12cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d5d474 - Browse repository at this point
Copy the full SHA 8d5d474View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5194be - Browse repository at this point
Copy the full SHA a5194beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 434e1bb - Browse repository at this point
Copy the full SHA 434e1bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e0c6ba - Browse repository at this point
Copy the full SHA 6e0c6baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d56d59 - Browse repository at this point
Copy the full SHA 8d56d59View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2728b9d - Browse repository at this point
Copy the full SHA 2728b9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f35d9dd - Browse repository at this point
Copy the full SHA f35d9ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb64bd1 - Browse repository at this point
Copy the full SHA fb64bd1View commit details -
http: use max js int value - 1 for content/chunk lengths
Before this it was possible that a Content-Length or chunk length of 9007199254740993 to be interpreted as 9007199254740992, making it impossible to know that the value was larger than our maximum. Using maximum js int value - 1 allows us to reliably detect when the max length has been exceeded.
Configuration menu - View commit details
-
Copy full SHA for 9bc7d5c - Browse repository at this point
Copy the full SHA 9bc7d5cView commit details -
http: remove unnecessary internal state variable
The folded state is no longer needed since we are now always deferring trimming of header values until the next new header or the end of the headers, whichever comes first.
Configuration menu - View commit details
-
Copy full SHA for 686ced1 - Browse repository at this point
Copy the full SHA 686ced1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b53d285 - Browse repository at this point
Copy the full SHA b53d285View commit details -
Configuration menu - View commit details
-
Copy full SHA for db67814 - Browse repository at this point
Copy the full SHA db67814View commit details -
This mainly fixes parsing of successive similar message types when there is a fixed-length body.
Configuration menu - View commit details
-
Copy full SHA for 7f8bf45 - Browse repository at this point
Copy the full SHA 7f8bf45View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0b0950 - Browse repository at this point
Copy the full SHA b0b0950View commit details -
Configuration menu - View commit details
-
Copy full SHA for 543afe7 - Browse repository at this point
Copy the full SHA 543afe7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05c3baa - Browse repository at this point
Copy the full SHA 05c3baaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b8afe5 - Browse repository at this point
Copy the full SHA 6b8afe5View commit details -
http: move keepalive boolean to flag
This improves performance some by not having to (re)set another instance property.
Configuration menu - View commit details
-
Copy full SHA for 86b6bda - Browse repository at this point
Copy the full SHA 86b6bdaView commit details -
The ternary expression is faster, but may not be noticeable.
Configuration menu - View commit details
-
Copy full SHA for cfb7f3e - Browse repository at this point
Copy the full SHA cfb7f3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae19bae - Browse repository at this point
Copy the full SHA ae19baeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6879858 - Browse repository at this point
Copy the full SHA 6879858View commit details -
Configuration menu - View commit details
-
Copy full SHA for f6c134f - Browse repository at this point
Copy the full SHA f6c134fView commit details -
Configuration menu - View commit details
-
Copy full SHA for f5197ae - Browse repository at this point
Copy the full SHA f5197aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for ede7529 - Browse repository at this point
Copy the full SHA ede7529View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61e1b0b - Browse repository at this point
Copy the full SHA 61e1b0bView commit details -
test: move http parser durability test to pummel
These tests take significantly longer to execute. Also the http 0.9 test has been corrected to reflect the capability of the current js parser.
Configuration menu - View commit details
-
Copy full SHA for f7c90ff - Browse repository at this point
Copy the full SHA f7c90ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 05480ac - Browse repository at this point
Copy the full SHA 05480acView commit details -
http: switch to regexp-less, LF-compatible js parser
See this[1] comment for more details and benchmark results. Notable changes: * Removed all regexps. Only request URLs are not validated currently. * Added globally configurable start line length limits * Chunk size parsing no longer line buffers * Lines can end in just LF too * Faster than the original regexp-based implementation [1] nodejs#1457 (comment)
Configuration menu - View commit details
-
Copy full SHA for c48053a - Browse repository at this point
Copy the full SHA c48053aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b7ee346 - Browse repository at this point
Copy the full SHA b7ee346View commit details -
Configuration menu - View commit details
-
Copy full SHA for d97942b - Browse repository at this point
Copy the full SHA d97942bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 79e2d60 - Browse repository at this point
Copy the full SHA 79e2d60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 526b24f - Browse repository at this point
Copy the full SHA 526b24fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 950582a - Browse repository at this point
Copy the full SHA 950582aView commit details -
test: port URL tests from joyent/http-parser
This only tests basic URL validation because the JS HTTP parser does not actually parse the URL into its individual parts.
Configuration menu - View commit details
-
Copy full SHA for 3a870f1 - Browse repository at this point
Copy the full SHA 3a870f1View commit details -
http: move property initialization to prototype
This bumps the large-alternate parser benchmark to ~19k+, making it match the result from joyent/http-parser 2.5.0.
Configuration menu - View commit details
-
Copy full SHA for d3247f1 - Browse repository at this point
Copy the full SHA d3247f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb32e80 - Browse repository at this point
Copy the full SHA fb32e80View commit details -
http: switch to regexp search for longer field names
Somewhere between 10 and 14 characters, the equalsLower() algorithm becomes slower than searching with a simple, case-insensitive, non-anchored regexp. This at least gives a consistently higher bump in the large-alternate parser benchmark.
Configuration menu - View commit details
-
Copy full SHA for 4af63d7 - Browse repository at this point
Copy the full SHA 4af63d7View commit details -
http: remove parser pause()/resume() usage
The js parser pause()/resume() are no-ops anyway.
Configuration menu - View commit details
-
Copy full SHA for 7ba6c2b - Browse repository at this point
Copy the full SHA 7ba6c2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3da4427 - Browse repository at this point
Copy the full SHA 3da4427View commit details -
Configuration menu - View commit details
-
Copy full SHA for d56a9f0 - Browse repository at this point
Copy the full SHA d56a9f0View commit details