Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
ae57a6bd
Commit
ae57a6bd
authored
Jan 22, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the variables that control gzip'ed ESI deliver to sp->wrk so
included files can get at them.
parent
f36b3ca6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
cache.h
bin/varnishd/cache.h
+3
-0
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+17
-16
No files found.
bin/varnishd/cache.h
View file @
ae57a6bd
...
@@ -290,6 +290,9 @@ struct worker {
...
@@ -290,6 +290,9 @@ struct worker {
/* ESI stuff */
/* ESI stuff */
struct
vep_state
*
vep
;
struct
vep_state
*
vep
;
int
gzip_resp
;
ssize_t
l_crc
;
uint32_t
crc
;
/* Timeouts */
/* Timeouts */
double
connect_timeout
;
double
connect_timeout
;
...
...
bin/varnishd/cache_esi_deliver.c
View file @
ae57a6bd
...
@@ -174,10 +174,9 @@ ESI_Deliver(struct sess *sp)
...
@@ -174,10 +174,9 @@ ESI_Deliver(struct sess *sp)
struct
storage
*
st
;
struct
storage
*
st
;
uint8_t
*
p
,
*
e
,
*
q
,
*
r
;
uint8_t
*
p
,
*
e
,
*
q
,
*
r
;
unsigned
off
;
unsigned
off
;
ssize_t
l
,
l_icrc
,
l_crc
=
0
;
ssize_t
l
,
l_icrc
;
uint32_t
crc
=
0
,
icrc
;
uint32_t
icrc
;
uint8_t
tailbuf
[
8
+
5
];
uint8_t
tailbuf
[
8
+
5
];
int
dogzip
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
st
=
sp
->
obj
->
esidata
;
st
=
sp
->
obj
->
esidata
;
...
@@ -185,13 +184,14 @@ ESI_Deliver(struct sess *sp)
...
@@ -185,13 +184,14 @@ ESI_Deliver(struct sess *sp)
p
=
st
->
ptr
;
p
=
st
->
ptr
;
e
=
st
->
ptr
+
st
->
len
;
e
=
st
->
ptr
+
st
->
len
;
if
(
*
p
==
VEC_GZ
)
{
if
(
sp
->
esi_level
==
0
)
{
p
++
;
if
(
*
p
==
VEC_GZ
)
{
dogzip
=
1
;
p
++
;
crc
=
crc32
(
0L
,
Z_NULL
,
0
);
sp
->
wrk
->
gzip_resp
=
1
;
l_crc
=
0
;
sp
->
wrk
->
crc
=
crc32
(
0L
,
Z_NULL
,
0
);
}
else
}
else
dogzip
=
0
;
sp
->
wrk
->
gzip_resp
=
0
;
}
st
=
VTAILQ_FIRST
(
&
sp
->
obj
->
store
);
st
=
VTAILQ_FIRST
(
&
sp
->
obj
->
store
);
off
=
0
;
off
=
0
;
...
@@ -202,14 +202,15 @@ ESI_Deliver(struct sess *sp)
...
@@ -202,14 +202,15 @@ ESI_Deliver(struct sess *sp)
case
VEC_V2
:
case
VEC_V2
:
case
VEC_V8
:
case
VEC_V8
:
l
=
ved_decode_len
(
&
p
);
l
=
ved_decode_len
(
&
p
);
if
(
dogzi
p
)
{
if
(
sp
->
wrk
->
gzip_res
p
)
{
assert
(
*
p
==
VEC_C1
||
*
p
==
VEC_C2
||
assert
(
*
p
==
VEC_C1
||
*
p
==
VEC_C2
||
*
p
==
VEC_C8
);
*
p
==
VEC_C8
);
l_icrc
=
ved_decode_len
(
&
p
);
l_icrc
=
ved_decode_len
(
&
p
);
icrc
=
vbe32dec
(
p
);
icrc
=
vbe32dec
(
p
);
p
+=
4
;
p
+=
4
;
crc
=
crc32_combine
(
crc
,
icrc
,
l_icrc
);
sp
->
wrk
->
crc
=
l_crc
+=
l_icrc
;
crc32_combine
(
sp
->
wrk
->
crc
,
icrc
,
l_icrc
);
sp
->
wrk
->
l_crc
+=
l_icrc
;
}
}
q
=
(
void
*
)
strchr
((
const
char
*
)
p
,
'\0'
);
q
=
(
void
*
)
strchr
((
const
char
*
)
p
,
'\0'
);
assert
(
q
>
p
);
assert
(
q
>
p
);
...
@@ -241,7 +242,7 @@ ESI_Deliver(struct sess *sp)
...
@@ -241,7 +242,7 @@ ESI_Deliver(struct sess *sp)
INCOMPL
();
INCOMPL
();
}
}
}
}
if
(
dogzip
)
{
if
(
sp
->
wrk
->
gzip_resp
&&
sp
->
esi_level
==
0
)
{
/* Emit a gzip literal block with finish bit set */
/* Emit a gzip literal block with finish bit set */
tailbuf
[
0
]
=
0x01
;
tailbuf
[
0
]
=
0x01
;
tailbuf
[
1
]
=
0x00
;
tailbuf
[
1
]
=
0x00
;
...
@@ -250,10 +251,10 @@ ESI_Deliver(struct sess *sp)
...
@@ -250,10 +251,10 @@ ESI_Deliver(struct sess *sp)
tailbuf
[
4
]
=
0xff
;
tailbuf
[
4
]
=
0xff
;
/* Emit CRC32 */
/* Emit CRC32 */
vle32enc
(
tailbuf
+
5
,
crc
);
vle32enc
(
tailbuf
+
5
,
sp
->
wrk
->
crc
);
/* MOD(2^32) length */
/* MOD(2^32) length */
vle32enc
(
tailbuf
+
9
,
l_crc
);
vle32enc
(
tailbuf
+
9
,
sp
->
wrk
->
l_crc
);
ved_sendchunk
(
sp
,
"d
\r\n
"
,
3
,
tailbuf
,
13
);
ved_sendchunk
(
sp
,
"d
\r\n
"
,
3
,
tailbuf
,
13
);
}
}
...
...
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