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
61367de4
Commit
61367de4
authored
Mar 22, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the CPP magic involved in HTTP headers, now that we can rely
on everybody agreeing about the order of these fields.
parent
e4996efa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
cache.h
bin/varnishd/cache/cache.h
+3
-7
cache_http.c
bin/varnishd/cache/cache_http.c
+5
-18
No files found.
bin/varnishd/cache/cache.h
View file @
61367de4
...
...
@@ -82,13 +82,9 @@ body_status(enum body_status e)
enum
{
/* Fields from the first line of HTTP proto */
HTTP_HDR_REQ
,
HTTP_HDR_URL
,
HTTP_HDR_PROTO
,
HTTP_HDR_STATUS
,
HTTP_HDR_RESPONSE
,
/* HTTP header lines */
HTTP_HDR_FIRST
,
#define SLTH(aa, bb) bb,
#include "tbl/vsl_tags_http.h"
#undef SLTH
};
struct
SHA256Context
;
...
...
bin/varnishd/cache/cache_http.c
View file @
61367de4
...
...
@@ -41,24 +41,11 @@
#include "tbl/http_headers.h"
#undef HTTPH
/*lint -save -e773 not () */
#define LOGMTX2(ax, bx, cx) [bx] = SLT_##ax##cx
#define LOGMTX1(ax) { \
LOGMTX2(ax, HTTP_HDR_REQ, Request), \
LOGMTX2(ax, HTTP_HDR_RESPONSE, Response), \
LOGMTX2(ax, HTTP_HDR_STATUS, Status), \
LOGMTX2(ax, HTTP_HDR_URL, URL), \
LOGMTX2(ax, HTTP_HDR_PROTO, Protocol), \
LOGMTX2(ax, HTTP_HDR_FIRST, Header), \
}
static
const
enum
VSL_tag_e
logmtx
[][
HTTP_HDR_FIRST
+
1
]
=
{
[
HTTP_Rx
]
=
LOGMTX1
(
Rx
),
[
HTTP_Tx
]
=
LOGMTX1
(
Tx
),
[
HTTP_Obj
]
=
LOGMTX1
(
Obj
)
static
const
enum
VSL_tag_e
foo
[]
=
{
[
HTTP_Rx
]
=
SLT_RxRequest
,
[
HTTP_Tx
]
=
SLT_TxRequest
,
[
HTTP_Obj
]
=
SLT_ObjRequest
,
};
/*lint -restore */
static
enum
VSL_tag_e
http2shmlog
(
const
struct
http
*
hp
,
int
t
)
...
...
@@ -69,7 +56,7 @@ http2shmlog(const struct http *hp, int t)
t
=
HTTP_HDR_FIRST
;
assert
(
hp
->
logtag
>=
HTTP_Rx
&&
hp
->
logtag
<=
HTTP_Obj
);
/*lint !e685*/
assert
(
t
>=
HTTP_HDR_REQ
&&
t
<=
HTTP_HDR_FIRST
);
return
(
logmtx
[
hp
->
logtag
][
t
]
);
return
(
(
enum
VSL_tag_e
)(
foo
[
hp
->
logtag
]
+
t
)
);
}
static
void
...
...
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