Closed aondio closed 7 years ago
have not checked the differences but I'm using https://github.com/nigoroll/libvmod-bodyaccess
As discussed during the aforementioned Monday we cannot AFAIK detect changes in the prototype of VRB_Iterate
. We can however either detect the req_body_iter_f
and objiterate_f
prototypes or use the Varnish version for the #ifdef
dance.
@aondio please have a look at 9854867, it compiles fine for me with 4.1 and fails just fine with 5.0 :)
See the TODO comments where I suppose you would add the 5.x alternative code.
In its current state the PR passes on my machine with Varnish 4.1.5 and 5.0.0 and apparently on Travis CI too. I'm not done with testing and polishing but feel free to have a look anyway. Please don't merge it yet.
Comments welcome regarding the handling of the test suite.
I think it can be merged now, please review.
tests/bodyaccess/5x/test04.vtc
fails with Varnish 5.1.2 so I'll investigate that before it can be reviewed.
It turns out the failure with 5.1.2 was a logic error in the test case. I have now fixed it and after I realized that enabling Hash
log records didn't show anything I tweaked the test case further and made the VMOD log what it's hashing.
This is again ready for a review.
Looks good to me
I'm merging this, and I will try to improve it further with a future pull request.
Thanks for the review!
Hi everyone, this PR acts as reminder, so we can discuss this on Monday during our internal meeting.
For the moment let's only consider Varnish Cache. As we discussed last week the intent of this PR is to add vmod_bodyacces to varnish-modules. As of today we want varnish-modules to build against VC 4.1/5.x.
PROBLEM:
This PR build successfully against VC 4.1, but not against 5.x.
One of the function used to iterate over the request body is VRB_Iterate and in Varnish Cache 4.1 that's its prototype: _ssize_t VRB_Iterate(struct req req, req_body_iter_f func, void priv);_ whereas the prototype for "req_body_iter_f" is: _typedef int (req_body_iter_f)(struct req , void priv, void ptr, sizet);
Starting from VC 5.0 VRB_Iterate changed to: _ssize_t VRB_Iterate(struct req , objiterate_f func, void priv);_ where objiterate_f is: _typedef int objiterate_f(void priv, int flush, const void *ptr, ssizet len);
This obviously means that the same branch will build only against VC4.1.
POSSIBLE SOLUTION:
We want a single branch to build against VC4.1/5.x. My suggested solution is:
Is this the BEST way to solve this problem? If it is, I'd like to have some input on point 1.
Looking forward to your ideas on Monday! :)