-
Notifications
You must be signed in to change notification settings - Fork 849
Adds a run-plugin operator to HRW #11320
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
Conversation
| run-plugin <plugin-name>.so "<plugin-argument> ..." | ||
|
|
||
| This allows to run an existing remap plugin, conditionally, from within a | ||
| header rewrite rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this run on any hook other than the remap hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it can only run in a remap hook, but the plugin it runs can setup other hooks.
|
Testing schmesting I guess. |
|
actually there is something wrong with the test. but basically with the plugin factory, you can achieve this anywhere else, like Lua plugin or txn_box |
|
I'll be on vacation for 2 weeks after today, so I'll I have to leave any further review to others. Looks OK from a quick read through. |
Yeh, well... I can't reproduce the build problem on either my Mac or my Linux box, but seems like it may be that the header_rewrite_test target needs a score dependency? |
|
[approve ci] |
1c7797e to
513fe05
Compare
| TSReleaseAssert(_plugin != nullptr); | ||
|
|
||
| if (res._rri && res.txnp) { | ||
| _plugin->doRemap(res.txnp, res._rri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. should we pass on the return status of the doRemap() function somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it is just ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, so we kinda butchered this a bit in all the refactoring and dealings with "chaining" remap plugins. In most cases, this return code is obsoleted, and we don't' really use it. So, I made a choice to ignore it in HRW, whereas in Cripts, the caller can chose to look at it and do something with it (albeit, I think that's unlikely).
I'm not sure the stop / continue works any more either, but almost no plugin that's in use uses that.
|
Cherry-picked to v10.0.x |
(cherry picked from commit aff07ef)
An example use case is to conditionally enable / run the rate_limit.so plugin for some requests: