Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-esicookies
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-esicookies
Commits
41053960
Commit
41053960
authored
Oct 16, 2014
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename to_http0* to to_esi*
Geoff likes these better.
parent
d935e2ae
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
31 deletions
+30
-31
README.rst
README.rst
+16
-17
vmod_esicookies.vtc
src/tests/vmod_esicookies.vtc
+3
-3
vmod_esicookies_corners.vtc
src/tests/vmod_esicookies_corners.vtc
+1
-1
vmod_esicookies_reload.vcl
src/tests/vmod_esicookies_reload.vcl
+3
-3
vmod_esicookies.c
src/vmod_esicookies.c
+5
-5
vmod_esicookies.vcc
src/vmod_esicookies.vcc
+2
-2
No files found.
README.rst
View file @
41053960
...
...
@@ -21,7 +21,7 @@ SYNOPSIS
import esicookies;
sub vcl_fetch {
esicookies.to_
http0
(beresp.http.Set-Cookie);
esicookies.to_
esi
(beresp.http.Set-Cookie);
}
Reporting of errors and warnings:
...
...
@@ -31,9 +31,9 @@ Reporting of errors and warnings:
import esicookies;
sub vcl_fetch {
set req.http.X-Err = esicookies.to_
http0
_e(beresp.http.Set-Cookie);
set req.http.X-Err = esicookies.to_
esi
_e(beresp.http.Set-Cookie);
if (req.http.X-Err && req.http.X-Err != "") {
error 503 "Error in to_
http0
";
error 503 "Error in to_
esi
";
}
set req.http.X-Warn = esicookies.warnings();
if (req.http.X-Warn == "") {
...
...
@@ -69,21 +69,18 @@ FUNCTIONS
See see synopsis_ for a typical (and the only tested) usage example.
.. _to
http0
:
.. _to
esi
:
to_
http0
to_
esi
--------
Prototype
::
esicookies.to_
http0
(HEADER);
esicookies.to_
esi
(HEADER);
The ``http0`` context contains a copy of the original request headers
as requested by the client.
When the ``to_http0`` function is called, all instances of the named
When the ``to_esi`` function is called, all instances of the named
``Set-Cookie`` reponse header and the original request's ``Cookie``
headers are parsed and a new ``Cookie`` header is generated in the
``http0`` context, which will be used for subsequent ESI requests and
...
...
@@ -110,17 +107,17 @@ Cookie line, if necessary. Sample output:
to_
http0
_e
to_
esi
_e
----------
Prototype
::
set ... = esicookies.to_
http0
_e(HEADER);
if (esicookies.to_
http0
_e(HEADER))
set ... = esicookies.to_
esi
_e(HEADER);
if (esicookies.to_
esi
_e(HEADER))
This form is semantically equivalent to to_
http0
_ except that is
This form is semantically equivalent to to_
esi
_ except that is
returns a string when an error is encountered.
Possible return strings are:
...
...
@@ -229,7 +226,7 @@ KNOWN ISSUES
warning is found.
* Varnish 3 releases differ in their behaviour with regard to empty
headers. Setting a header to the result of the to_
http0
_e_ and
headers. Setting a header to the result of the to_
esi
_e_ and
warnings_ functions may produce a header with no value.
To ensure compatibility with all Varnish 3 releases, always use the
...
...
@@ -244,14 +241,16 @@ HISTORY / CHANGELOG
* Version 1.1: Initial version.
* to_
http0
_e_ now returns NULL when there was no error.
* to_
esi
_e_ now returns NULL when there was no error.
* changed strings returned by to_
http0
_e_
* changed strings returned by to_
esi
_e_
* Added the warnings_ function and VSM logging for parse warnings.
* The parser is now more tolarant
* rename `to_esi` to `to_esi` and `to_esi_e` to `to_esi_e`
COPYRIGHT
=========
...
...
src/tests/vmod_esicookies.vtc
View file @
41053960
...
...
@@ -57,11 +57,11 @@ varnish v1 -vcl+backend {
sub vcl_fetch {
if (req.url == "/body2") {
esicookies.to_
http0
(beresp.http.Set-Cookie);
esicookies.to_
esi
(beresp.http.Set-Cookie);
} else {
set req.http.X-Err = esicookies.to_
http0
_e(beresp.http.Set-Cookie);
set req.http.X-Err = esicookies.to_
esi
_e(beresp.http.Set-Cookie);
if (req.http.X-Err
&&
req.http.X-Err != "") {
error 503 "Error in to_
http0
";
error 503 "Error in to_
esi
";
}
set req.http.X-Warn = esicookies.warnings();
if (req.http.X-Warn == "") {
...
...
src/tests/vmod_esicookies_corners.vtc
View file @
41053960
...
...
@@ -146,7 +146,7 @@ varnish v1 -vcl+backend {
import esicookies from "${vmod_topbuild}/src/.libs/libvmod_esicookies.so" ;
sub vcl_fetch {
set req.http.X-Err = esicookies.to_
http0
_e(beresp.http.Set-Cookie);
set req.http.X-Err = esicookies.to_
esi
_e(beresp.http.Set-Cookie);
if (req.http.X-Err == "") {
unset req.http.X-Err;
}
...
...
src/tests/vmod_esicookies_reload.vcl
View file @
41053960
...
...
@@ -4,11 +4,11 @@
sub vcl_fetch {
if (req.url == "/body2") {
esicookies.to_
http0
(beresp.http.Set-Cookie);
esicookies.to_
esi
(beresp.http.Set-Cookie);
} else {
set req.http.X-Err = esicookies.to_
http0
_e(beresp.http.Set-Cookie);
set req.http.X-Err = esicookies.to_
esi
_e(beresp.http.Set-Cookie);
if (req.http.X-Err && req.http.X-Err != "") {
error 503 "Error in to_
http0
";
error 503 "Error in to_
esi
";
}
}
set beresp.do_esi = true;
...
...
src/vmod_esicookies.c
View file @
41053960
...
...
@@ -584,7 +584,7 @@ vesico_write_cookie_hdr(struct sess *sp, struct vesico_req *m,
*/
static
const
char
*
vesico_to_
http0
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
vesico_to_
esi
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
const
char
*
hdr
)
{
struct
vesico_req
*
m
;
...
...
@@ -698,9 +698,9 @@ vesico_to_http0(struct sess *sp, struct vmod_priv *priv, enum gethdr_e where,
}
const
char
*
__match_proto__
()
vmod_to_
http0
_e
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
vmod_to_
esi
_e
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
const
char
*
hdr
)
{
return
(
vesico_to_
http0
(
sp
,
priv
,
where
,
hdr
));
return
(
vesico_to_
esi
(
sp
,
priv
,
where
,
hdr
));
}
const
char
*
__match_proto__
()
...
...
@@ -719,7 +719,7 @@ vmod_warnings(struct sess *sp, struct vmod_priv *priv) {
}
void
__match_proto__
()
vmod_to_
http0
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
vmod_to_
esi
(
struct
sess
*
sp
,
struct
vmod_priv
*
priv
,
enum
gethdr_e
where
,
const
char
*
hdr
)
{
return
(
void
)(
vesico_to_
http0
(
sp
,
priv
,
where
,
hdr
));
return
(
void
)(
vesico_to_
esi
(
sp
,
priv
,
where
,
hdr
));
}
src/vmod_esicookies.vcc
View file @
41053960
...
...
@@ -27,6 +27,6 @@
Module esicookies
Init init_function
Function STRING to_
http0
_e(PRIV_VCL, HEADER)
Function VOID to_
http0
(PRIV_VCL, HEADER)
Function STRING to_
esi
_e(PRIV_VCL, HEADER)
Function VOID to_
esi
(PRIV_VCL, HEADER)
Function STRING warnings(PRIV_VCL)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment