Skip to content
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

Rewrite for new proposed VRB_Iterate() API #9

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

nigoroll
Copy link
Contributor

@nigoroll nigoroll commented Jul 4, 2022

I have spent quite a relevant amount of time to adopt the vmod to the new proposed VRB_Iterate() interface, just to find out that the VMOD does not actually fit my requirements because I do need raw XML parsing. But I have learned a lot on the way and hopefully we will get the improved interface which is useful in its own right.
Anyway, I am dropping my work here in case it can later be picked up again or be of use in any other way.
This series of patches implements the following changes:

  • Introduce an OO interface for parametrized soap parsers
  • Refactor request processing to stop crossing Varnish API borders and use the VRB_Iterate() interface, see commit message of 1cd6768 for details
  • Add parsing of response bodies

nigoroll added 24 commits May 20, 2022 16:08
Vmods are banned from cache_param for quite some time now, so the
vmod should have its own parameter for the gzip buffer size.
Much more can be done here to reduce the required varnish internal
headers, but for now this commit concludes the required changes for
varnish-cache master as of now (post 7.1)
varnish-cache serializes the vmod events, so, unless the vmod itself has
any concurent access, no mutex is required.
See varnishcache/varnish-cache#3798 (comment)

Changes:

* need std.cache_req_body() now

Unless the request body is only used by the soap vmod (that is, whenever it is
to be sent to the backend also), std.cache_req_body(), optionally with the partial
argument, needs to be used to cache at least as much of the request body
to fulfil any xml lookup used.

Partial caching can be used if, for example, only the XML header is read and the
header is known to be placed at the top.

* VCL is now responsible for checking Content-Encoding

... because it could push filters to support other Content-Encodings

* Varnish Cache supports chunked Encoding for bodies

The test for a body with no Content-Length and no Chunked-Encoding did
not make sense, request bodies could never be closed with "EOL" semantics
(write side shutdown), not even in HTTP/1.0

https://www.rfc-editor.org/rfc/rfc1945.html#section-8.3

   A valid Content-Length is required on all HTTP/1.0 POST requests.

* Polish vcc file

$ABI is implicitly required by varnish-cache as of af87f0cd1a7b8be8a124dca355f04dd641bc5512

The $Module quotes are currently not required.
As of now, the response body must be uncached.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant