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
abeded8d
Commit
abeded8d
authored
Apr 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vector request failuers through the transport protocol
parent
4743b17b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
cache_req.c
bin/varnishd/cache/cache_req.c
+4
-3
cache_transport.h
bin/varnishd/cache/cache_transport.h
+2
-0
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+8
-0
No files found.
bin/varnishd/cache/cache_req.c
View file @
abeded8d
...
...
@@ -39,6 +39,7 @@
#include "cache.h"
#include "cache_pool.h"
#include "cache_transport.h"
#include "vtim.h"
...
...
@@ -209,11 +210,11 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
/*----------------------------------------------------------------------
*/
void
__match_proto__
()
void
__match_proto__
(
vtr_req_fail_f
)
Req_Fail
(
struct
req
*
req
,
enum
sess_close
reason
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
sp
->
fd
>=
0
)
SES_Close
(
req
->
sp
,
reason
);
AN
(
req
->
transport
->
req_fail
);
req
->
transport
->
req_fail
(
req
,
reason
);
}
bin/varnishd/cache/cache_transport.h
View file @
abeded8d
...
...
@@ -40,6 +40,7 @@ typedef void vtr_deliver_f (struct req *, struct boc *, int sendbody);
typedef
void
vtr_req_body_f
(
struct
req
*
);
typedef
void
vtr_sess_panic_f
(
struct
vsb
*
,
const
struct
sess
*
);
typedef
void
vtr_req_panic_f
(
struct
vsb
*
,
const
struct
req
*
);
typedef
void
vtr_req_fail_f
(
struct
req
*
,
enum
sess_close
);
struct
transport
{
unsigned
magic
;
...
...
@@ -52,6 +53,7 @@ struct transport {
task_func_t
*
new_session
;
task_func_t
*
unwait
;
vtr_req_fail_f
*
req_fail
;
vtr_req_body_f
*
req_body
;
vtr_deliver_f
*
deliver
;
vtr_sess_panic_f
*
sess_panic
;
...
...
bin/varnishd/http1/cache_http1_fsm.c
View file @
abeded8d
...
...
@@ -168,12 +168,20 @@ http1_req_panic(struct vsb *vsb, const struct req *req)
VSB_printf
(
vsb
,
"state = %s
\n
"
,
http1_getstate
(
req
->
sp
));
}
static
void
__match_proto__
(
vtr_req_fail_f
)
http1_req_fail
(
struct
req
*
req
,
enum
sess_close
reason
)
{
if
(
req
->
sp
->
fd
>=
0
)
SES_Close
(
req
->
sp
,
reason
);
}
struct
transport
HTTP1_transport
=
{
.
name
=
"HTTP/1"
,
.
magic
=
TRANSPORT_MAGIC
,
.
deliver
=
V1D_Deliver
,
.
unwait
=
http1_unwait
,
.
req_body
=
http1_req_body
,
.
req_fail
=
http1_req_fail
,
.
new_session
=
http1_new_session
,
.
sess_panic
=
http1_sess_panic
,
.
req_panic
=
http1_req_panic
,
...
...
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