Skip to content

Add support of raw_body hooks#123

Closed
socketpair wants to merge 4 commits intoOISF:0.5.xfrom
socketpair:raw_body_hook
Closed

Add support of raw_body hooks#123
socketpair wants to merge 4 commits intoOISF:0.5.xfrom
socketpair:raw_body_hook

Conversation

@socketpair
Copy link
Copy Markdown

This simplifies writing of transparent HTTP-proxies with this library

@socketpair
Copy link
Copy Markdown
Author

Unfortunatelly I don't know how to add tests...

Comment thread htp/htp_config_private.h Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To maintain binary compatibility this should be added to the end of the structure.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not user-accessible structure. Should I fix that? So, if user upgrades libhtp, binary compatibility issue should never happen. Does not it ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even thought it's in a file named 'private' it actually exposed. At least Suricata uses it, and even though we never seem to access the structure directly, I am rather safe that sorry. When we bump to 0.6.x we can reshuffle it again. A similar case is here: 5b43aff#diff-9815a4e5141bd3d3914c1b5f9295fdecR337

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@inliniac
Copy link
Copy Markdown
Contributor

You can take this commit as an example for adding tests b85cb3a

Comment thread test/test_main.cpp Outdated
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these printfs are not suited for complete code, but for intermediate debugging only.

Callbacks are not fired. What I'm doing wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where in your patch are you invoking the new callbacks?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nowhere. Due to changes in htp/htp_request.c and htp/htp_response.c it should be called automatically. does not it? I'm novice in libhtp, and make patch as copy-paste with headers_data callbacks. Maybe I forgot something ?

This simplifies writing of transparent HTTP-proxies with this library
Comment thread test/test_main.cpp
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@inliniac sorry. I have fixed bugs in my tests. Now everything is fine.

Unfortunately, without the first lines of request and response.
@socketpair
Copy link
Copy Markdown
Author

Well, @inliniac, why not to merge ?

@socketpair
Copy link
Copy Markdown
Author

I'm not interested in libhtp anymore

@socketpair socketpair closed this Dec 14, 2017
@socketpair socketpair deleted the raw_body_hook branch December 14, 2017 16:13
jasonish added a commit to jasonish/suricata that referenced this pull request May 7, 2024
For GitHub, add the following branch name formats:
- OISF/libhtp#123
- OISF/libhtp#123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants