Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
b25cfdc9
Commit
b25cfdc9
authored
Jun 03, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify http_Teardown() a bit.
parent
aadf302e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
cache.h
bin/varnishd/cache/cache.h
+8
-5
cache_http.c
bin/varnishd/cache/cache_http.c
+7
-15
No files found.
bin/varnishd/cache/cache.h
View file @
b25cfdc9
...
...
@@ -186,16 +186,19 @@ struct http {
unsigned
magic
;
#define HTTP_MAGIC 0x6428b5c9
enum
VSL_tag_e
logtag
;
/* Must be SLT_*Method */
struct
vsl_log
*
vsl
;
struct
ws
*
ws
;
uint16_t
shd
;
/* Size of hd space */
txt
*
hd
;
unsigned
char
*
hdf
;
#define HDF_FILTER (1 << 0)
/* Filtered by Connection */
#define HDF_MARKER (1 << 1)
/* Marker bit */
uint16_t
shd
;
/* Size of hd space */
/* NB: ->nhd and below zeroed/initialized by http_Teardown */
uint16_t
nhd
;
/* Next free hd */
enum
VSL_tag_e
logtag
;
/* Must be SLT_*Method */
struct
vsl_log
*
vsl
;
struct
ws
*
ws
;
uint16_t
status
;
uint8_t
protover
;
uint8_t
conds
;
/* If-* headers present */
...
...
bin/varnishd/cache/cache_http.c
View file @
b25cfdc9
...
...
@@ -32,6 +32,7 @@
#include "config.h"
#include <stdio.h>
#include <stddef.h>
#include "cache.h"
...
...
@@ -155,22 +156,13 @@ HTTP_Setup(struct http *hp, struct ws *ws, struct vsl_log *vsl,
void
http_Teardown
(
struct
http
*
hp
)
{
uint16_t
shd
;
txt
*
hd
;
unsigned
char
*
hdf
;
/* XXX: This is not elegant, is it efficient ? */
shd
=
hp
->
shd
;
hd
=
hp
->
hd
;
hdf
=
hp
->
hdf
;
memset
(
hp
,
0
,
sizeof
*
hp
);
memset
(
hd
,
0
,
sizeof
*
hd
*
shd
);
memset
(
hdf
,
0
,
sizeof
*
hdf
*
shd
);
hp
->
magic
=
HTTP_MAGIC
;
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
AN
(
hp
->
shd
);
memset
(
&
hp
->
nhd
,
0
,
sizeof
*
hp
-
offsetof
(
struct
http
,
nhd
));
memset
(
hp
->
hd
,
0
,
sizeof
*
hp
->
hd
*
hp
->
shd
);
memset
(
hp
->
hdf
,
0
,
sizeof
*
hp
->
hdf
*
hp
->
shd
);
hp
->
nhd
=
HTTP_HDR_FIRST
;
hp
->
shd
=
shd
;
hp
->
hd
=
hd
;
hp
->
hdf
=
hdf
;
}
/*--------------------------------------------------------------------*/
...
...
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