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
2700f6cd
Commit
2700f6cd
authored
Jan 22, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of cleanup
parent
92d43d17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
25 deletions
+12
-25
cache.h
bin/varnishd/cache.h
+1
-1
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+4
-6
cache_esi_fetch.c
bin/varnishd/cache_esi_fetch.c
+6
-17
cache_gzip.c
bin/varnishd/cache_gzip.c
+1
-1
No files found.
bin/varnishd/cache.h
View file @
2700f6cd
...
@@ -632,7 +632,7 @@ enum vgz_flag { VGZ_NORMAL, VGZ_ALIGN, VGZ_RESET, VGZ_FINISH };
...
@@ -632,7 +632,7 @@ enum vgz_flag { VGZ_NORMAL, VGZ_ALIGN, VGZ_RESET, VGZ_FINISH };
struct
vgz
*
VGZ_NewUngzip
(
const
struct
sess
*
sp
,
struct
ws
*
tmp
);
struct
vgz
*
VGZ_NewUngzip
(
const
struct
sess
*
sp
,
struct
ws
*
tmp
);
struct
vgz
*
VGZ_NewGzip
(
const
struct
sess
*
sp
,
struct
ws
*
tmp
);
struct
vgz
*
VGZ_NewGzip
(
const
struct
sess
*
sp
,
struct
ws
*
tmp
);
void
VGZ_Ibuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
void
VGZ_Ibuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
int
VGZ_IbufEmpty
(
struct
vgz
*
vg
);
int
VGZ_IbufEmpty
(
const
struct
vgz
*
vg
);
void
VGZ_Obuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
void
VGZ_Obuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
int
VGZ_ObufStorage
(
const
struct
sess
*
sp
,
struct
vgz
*
vg
);
int
VGZ_ObufStorage
(
const
struct
sess
*
sp
,
struct
vgz
*
vg
);
int
VGZ_Gzip
(
struct
vgz
*
,
const
void
**
,
size_t
*
len
,
enum
vgz_flag
);
int
VGZ_Gzip
(
struct
vgz
*
,
const
void
**
,
size_t
*
len
,
enum
vgz_flag
);
...
...
bin/varnishd/cache_esi_deliver.c
View file @
2700f6cd
...
@@ -174,8 +174,8 @@ ESI_Deliver(struct sess *sp)
...
@@ -174,8 +174,8 @@ 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
;
ssize_t
l
,
l_icrc
,
l_crc
=
0
;
uint32_t
crc
,
icrc
;
uint32_t
crc
=
0
,
icrc
;
uint8_t
tailbuf
[
8
+
5
];
uint8_t
tailbuf
[
8
+
5
];
int
dogzip
;
int
dogzip
;
...
@@ -208,13 +208,11 @@ ESI_Deliver(struct sess *sp)
...
@@ -208,13 +208,11 @@ ESI_Deliver(struct sess *sp)
l_icrc
=
ved_decode_len
(
&
p
);
l_icrc
=
ved_decode_len
(
&
p
);
icrc
=
vbe32dec
(
p
);
icrc
=
vbe32dec
(
p
);
p
+=
4
;
p
+=
4
;
}
q
=
(
void
*
)
strchr
((
const
char
*
)
p
,
'\0'
);
assert
(
q
>
p
);
if
(
dogzip
)
{
crc
=
crc32_combine
(
crc
,
icrc
,
l_icrc
);
crc
=
crc32_combine
(
crc
,
icrc
,
l_icrc
);
l_crc
+=
l_icrc
;
l_crc
+=
l_icrc
;
}
}
q
=
(
void
*
)
strchr
((
const
char
*
)
p
,
'\0'
);
assert
(
q
>
p
);
ved_sendchunk
(
sp
,
p
,
q
-
p
,
st
->
ptr
+
off
,
l
);
ved_sendchunk
(
sp
,
p
,
q
-
p
,
st
->
ptr
+
off
,
l
);
off
+=
l
;
off
+=
l
;
p
=
q
+
1
;
p
=
q
+
1
;
...
...
bin/varnishd/cache_esi_fetch.c
View file @
2700f6cd
...
@@ -113,6 +113,7 @@ vfp_esi_bytes_gu(struct sess *sp, struct http_conn *htc, size_t bytes)
...
@@ -113,6 +113,7 @@ vfp_esi_bytes_gu(struct sess *sp, struct http_conn *htc, size_t bytes)
if
(
VGZ_ObufStorage
(
sp
,
vg
))
if
(
VGZ_ObufStorage
(
sp
,
vg
))
return
(
-
1
);
return
(
-
1
);
i
=
VGZ_Gunzip
(
vg
,
&
dp
,
&
dl
);
i
=
VGZ_Gunzip
(
vg
,
&
dp
,
&
dl
);
xxxassert
(
i
==
Z_OK
||
i
==
Z_STREAM_END
);
VEP_parse
(
sp
,
dp
,
dl
);
VEP_parse
(
sp
,
dp
,
dl
);
sp
->
obj
->
len
+=
dl
;
sp
->
obj
->
len
+=
dl
;
}
}
...
@@ -136,8 +137,6 @@ struct vef_priv {
...
@@ -136,8 +137,6 @@ struct vef_priv {
* We receive a ungzip'ed object, and want to store it gzip'ed.
* We receive a ungzip'ed object, and want to store it gzip'ed.
*/
*/
#include "vend.h"
static
ssize_t
static
ssize_t
vfp_vep_callback
(
const
struct
sess
*
sp
,
ssize_t
l
,
enum
vgz_flag
flg
)
vfp_vep_callback
(
const
struct
sess
*
sp
,
ssize_t
l
,
enum
vgz_flag
flg
)
{
{
...
@@ -146,8 +145,6 @@ vfp_vep_callback(const struct sess *sp, ssize_t l, enum vgz_flag flg)
...
@@ -146,8 +145,6 @@ vfp_vep_callback(const struct sess *sp, ssize_t l, enum vgz_flag flg)
const
void
*
dp
;
const
void
*
dp
;
int
i
;
int
i
;
printf
(
"ZCB(%jd, %d)
\n
"
,
l
,
flg
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
vef
=
sp
->
wrk
->
vef_priv
;
vef
=
sp
->
wrk
->
vef_priv
;
CHECK_OBJ_NOTNULL
(
vef
,
VEF_MAGIC
);
CHECK_OBJ_NOTNULL
(
vef
,
VEF_MAGIC
);
...
@@ -166,18 +163,14 @@ printf("ZCB(%jd, %d)\n", l, flg);
...
@@ -166,18 +163,14 @@ printf("ZCB(%jd, %d)\n", l, flg);
return
(
vef
->
tot
);
return
(
vef
->
tot
);
}
}
i
=
VGZ_Gzip
(
vef
->
vgz
,
&
dp
,
&
dl
,
flg
);
i
=
VGZ_Gzip
(
vef
->
vgz
,
&
dp
,
&
dl
,
flg
);
printf
(
"GZI = %d %jd
\n
"
,
i
,
dl
);
vef
->
tot
+=
dl
;
vef
->
tot
+=
dl
;
sp
->
obj
->
len
+=
dl
;
sp
->
obj
->
len
+=
dl
;
}
while
(
!
VGZ_IbufEmpty
(
vef
->
vgz
));
}
while
(
!
VGZ_IbufEmpty
(
vef
->
vgz
));
vef
->
bufp
+=
l
;
vef
->
bufp
+=
l
;
if
(
flg
==
VGZ_FINISH
)
if
(
flg
==
VGZ_FINISH
)
assert
(
i
==
1
);
/* XXX */
assert
(
i
==
1
);
/* XXX */
else
else
assert
(
i
==
0
);
/* XXX */
assert
(
i
==
0
);
/* XXX */
printf
(
"ZCB = %jd
\n
"
,
vef
->
tot
);
fflush
(
stdout
);
usleep
(
100
);
return
(
vef
->
tot
);
return
(
vef
->
tot
);
}
}
...
@@ -256,7 +249,6 @@ vfp_esi_bytes(struct sess *sp, struct http_conn *htc, size_t bytes)
...
@@ -256,7 +249,6 @@ vfp_esi_bytes(struct sess *sp, struct http_conn *htc, size_t bytes)
int
i
;
int
i
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
printf
(
"BYTES = %jd
\n
"
,
bytes
);
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
i
=
vfp_esi_bytes_gu
(
sp
,
htc
,
bytes
);
i
=
vfp_esi_bytes_gu
(
sp
,
htc
,
bytes
);
else
if
(
sp
->
wrk
->
is_gunzip
&&
sp
->
wrk
->
do_gzip
)
else
if
(
sp
->
wrk
->
is_gunzip
&&
sp
->
wrk
->
do_gzip
)
...
@@ -265,7 +257,6 @@ printf("BYTES = %jd\n", bytes);
...
@@ -265,7 +257,6 @@ printf("BYTES = %jd\n", bytes);
i
=
vfp_esi_bytes_gg
(
sp
,
htc
,
bytes
);
i
=
vfp_esi_bytes_gg
(
sp
,
htc
,
bytes
);
else
else
i
=
vfp_esi_bytes_uu
(
sp
,
htc
,
bytes
);
i
=
vfp_esi_bytes_uu
(
sp
,
htc
,
bytes
);
printf
(
"BYTES = %d
\n
"
,
i
);
return
(
i
);
return
(
i
);
}
}
...
@@ -276,7 +267,6 @@ vfp_esi_end(struct sess *sp)
...
@@ -276,7 +267,6 @@ vfp_esi_end(struct sess *sp)
struct
vef_priv
*
vef
;
struct
vef_priv
*
vef
;
ssize_t
l
;
ssize_t
l
;
printf
(
"END
\n
"
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
VGZ_Destroy
(
&
sp
->
wrk
->
vgz_rx
);
VGZ_Destroy
(
&
sp
->
wrk
->
vgz_rx
);
...
@@ -299,8 +289,7 @@ printf("END\n");
...
@@ -299,8 +289,7 @@ printf("END\n");
sp
->
wrk
->
vef_priv
=
NULL
;
sp
->
wrk
->
vef_priv
=
NULL
;
CHECK_OBJ_NOTNULL
(
vef
,
VEF_MAGIC
);
CHECK_OBJ_NOTNULL
(
vef
,
VEF_MAGIC
);
XXXAZ
(
vef
->
error
);
XXXAZ
(
vef
->
error
);
printf
(
"TOT %jd
\n
"
,
vef
->
tot
);
// sp->obj->len = vef->tot;
sp
->
obj
->
len
=
vef
->
tot
;
}
}
return
(
0
);
return
(
0
);
}
}
...
...
bin/varnishd/cache_gzip.c
View file @
2700f6cd
...
@@ -202,7 +202,7 @@ VGZ_Ibuf(struct vgz *vg, const void *ptr, ssize_t len)
...
@@ -202,7 +202,7 @@ VGZ_Ibuf(struct vgz *vg, const void *ptr, ssize_t len)
}
}
int
int
VGZ_IbufEmpty
(
struct
vgz
*
vg
)
VGZ_IbufEmpty
(
const
struct
vgz
*
vg
)
{
{
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
...
...
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