bjoern icon indicating copy to clipboard operation
bjoern copied to clipboard

Update to new http-parser API

Open jonashaag opened this issue 13 years ago • 10 comments
trafficstars

They removed the path and query callbacks and added a URL parsing utility instead.

jonashaag avatar Jan 07 '12 23:01 jonashaag

@jonashaag what is it's status now ?

sideffect0 avatar Mar 29 '17 04:03 sideffect0

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.

jonashaag avatar Mar 29 '17 07:03 jonashaag

how tests are organised, & what about development dependencies ?

sideffect0 avatar Mar 29 '17 09:03 sideffect0

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?

jonashaag avatar Mar 29 '17 12:03 jonashaag

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

jelly avatar Mar 22 '19 14:03 jelly

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.

jelly avatar Mar 22 '19 14:03 jelly

@jonashaag any comments? tips?

jelly avatar Apr 23 '19 11:04 jelly

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 ;)

jonashaag avatar Apr 23 '19 11:04 jonashaag

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.

jelly avatar May 07 '19 20:05 jelly

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...

jonashaag avatar May 07 '19 20:05 jonashaag