bjoern
bjoern copied to clipboard
Update to new http-parser API
They removed the path and query callbacks and added a URL parsing utility instead.
@jonashaag what is it's status now ?
I'm happy to see this done by someone else :-) There's no pressure for this, though, since the old version we're using works really well.
how tests are organised, & what about development dependencies ?
There aren't many real unittests -- most testing is done manually by simply starting some WSGI application and using a real browser.
what about development dependencies ?
What do you mean by that?
I would really like to package bjoern for Debian/Arch and the bundling of http-parser is generally "not done" for these distro's. I've made a branch with one commit c93574eb19e0614787fca0c7ea7bb07e8d1da687 to make it compatible with http-parser by renaming the offending enum, this leaves two minor compiler warnings. I've tested the change with our API and so far it seems to work, how would I test this further?
My second more "controversial" change removes the bundling, making building it with system libs optional would be fine for me too. fe4621635119d616e4a488804fe912de31bef245
Update, I tested it further and it segfaults now with our full API testsuite:
segfault at a ip 00007fe76061da12 sp 00007ffca4e2a3f0 error 4 in _bjoern.cpython-37m-x86_64-linux-gnu.so[7fe76061d000+3000]
This was a bit of an ignorant update, I can see that the callbacks changed in http-parser and by luck it still compiled. Fixing that fixes the segfault, but in 53adfacad1c16ec7da7de4a0aee03c2d70f19618 they removed on_query_string which bjoern really needs and an alternative needs to be found for.
@jonashaag any comments? tips?
Sorry what’s your question exactly? There’s some kind of migration tips in the http parser documentation (not sure where but you’ll find it ;)
Ah, well I couldn't find any migration documentation on https://github.com/nodejs/http-parser and there is a bugreport open for a CHANGES file.
You're right, it's kind of difficult to find. There's some info here: https://github.com/nodejs/http-parser/pull/54 and some here: https://github.com/nodejs/http-parser/pull/58
I guess the best way is to compare the old README with the current one...