Closed indutny closed 4 years ago
Yes, that would be very useful.
This would be very helpful indeed. We're currently using modified http_parse and I'd like to switch to llhttp. We need to add RTSP support, which brings additional methods, one of which is GET_PARAMETER
, which conflicts with GET
. Our workaround right now is to append space to METHOD_MAP keys and then skip immediately to req_spaces_before_url
(ignoring req_first_space_before_url
).
It's not the end of the world, but having this working out of box would be much nicer :)
Just in case it helps someone, this commit in my fork adds RSTP support to llhttp. While having to append space to remove conflict is less than ideal, it's still lot cleaner than adding RTSP to original http-parser :)
I've just published a new version of llparse that supports this. Could you give it a try?
Thanks! I gave it a go, unfortunately it doesn't seem to work for me. You can see my branch here. It builds the parser but tests fail.
I might be doing something wrong, but I have both GET
and GET_PARAMETER
methods defined, all tests fail with method=0
instead of expected method=1
. If I remove GET_PARAMETER
method from the list tests pass.
Gosh, values... Sorry!
Alright. Should be really fixed now. Please give it another try!
Seems to be working! Tests passed and I did some testing with built parser which also works. Thanks!
Yay! Glad to help!
It should be possible to generate code for:
The compiler could turn it into a tree of
match
+peek
.