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
2ce73679
Unverified
Commit
2ce73679
authored
Dec 28, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralize delete session by htc status for reuse
adds handling of HTC_S_JUNK
parent
98f55dae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
16 deletions
+31
-16
cache_session.c
bin/varnishd/cache/cache_session.c
+28
-0
cache_transport.h
bin/varnishd/cache/cache_transport.h
+1
-0
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+2
-16
No files found.
bin/varnishd/cache/cache_session.c
View file @
2ce73679
...
@@ -586,6 +586,34 @@ SES_Delete(struct sess *sp, enum sess_close reason, vtim_real now)
...
@@ -586,6 +586,34 @@ SES_Delete(struct sess *sp, enum sess_close reason, vtim_real now)
SES_Rel
(
sp
);
SES_Rel
(
sp
);
}
}
void
SES_DeleteHS
(
struct
sess
*
sp
,
enum
htc_status_e
hs
,
vtim_real
now
)
{
enum
sess_close
reason
;
switch
(
hs
)
{
case
HTC_S_JUNK
:
reason
=
SC_RX_JUNK
;
break
;
case
HTC_S_CLOSE
:
reason
=
SC_REM_CLOSE
;
break
;
case
HTC_S_TIMEOUT
:
reason
=
SC_RX_TIMEOUT
;
break
;
case
HTC_S_OVERFLOW
:
reason
=
SC_RX_OVERFLOW
;
break
;
case
HTC_S_EOF
:
reason
=
SC_REM_CLOSE
;
break
;
default:
WRONG
(
"htc_status (bad)"
);
}
SES_Delete
(
sp
,
reason
,
now
);
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
*/
*/
...
...
bin/varnishd/cache/cache_transport.h
View file @
2ce73679
...
@@ -82,6 +82,7 @@ int VPX_Send_Proxy(int fd, int version, const struct sess *);
...
@@ -82,6 +82,7 @@ int VPX_Send_Proxy(int fd, int version, const struct sess *);
/* cache_session.c */
/* cache_session.c */
struct
sess
*
SES_New
(
struct
pool
*
);
struct
sess
*
SES_New
(
struct
pool
*
);
void
SES_Delete
(
struct
sess
*
,
enum
sess_close
reason
,
vtim_real
now
);
void
SES_Delete
(
struct
sess
*
,
enum
sess_close
reason
,
vtim_real
now
);
void
SES_DeleteHS
(
struct
sess
*
,
enum
htc_status_e
hs
,
vtim_real
now
);
void
SES_Close
(
struct
sess
*
,
enum
sess_close
reason
);
void
SES_Close
(
struct
sess
*
,
enum
sess_close
reason
);
void
SES_SetTransport
(
struct
worker
*
,
struct
sess
*
,
struct
req
*
,
void
SES_SetTransport
(
struct
worker
*
,
struct
sess
*
,
struct
req
*
,
const
struct
transport
*
);
const
struct
transport
*
);
bin/varnishd/http1/cache_http1_fsm.c
View file @
2ce73679
...
@@ -325,22 +325,8 @@ HTTP1_Session(struct worker *wrk, struct req *req)
...
@@ -325,22 +325,8 @@ HTTP1_Session(struct worker *wrk, struct req *req)
req
->
htc
->
rxbuf_e
-
req
->
htc
->
rxbuf_b
;
req
->
htc
->
rxbuf_e
-
req
->
htc
->
rxbuf_b
;
Req_AcctLogCharge
(
wrk
->
stats
,
req
);
Req_AcctLogCharge
(
wrk
->
stats
,
req
);
Req_Release
(
req
);
Req_Release
(
req
);
switch
(
hs
)
{
SES_DeleteHS
(
sp
,
hs
,
NAN
);
case
HTC_S_CLOSE
:
return
;
SES_Delete
(
sp
,
SC_REM_CLOSE
,
NAN
);
return
;
case
HTC_S_TIMEOUT
:
SES_Delete
(
sp
,
SC_RX_TIMEOUT
,
NAN
);
return
;
case
HTC_S_OVERFLOW
:
SES_Delete
(
sp
,
SC_RX_OVERFLOW
,
NAN
);
return
;
case
HTC_S_EOF
:
SES_Delete
(
sp
,
SC_REM_CLOSE
,
NAN
);
return
;
default:
WRONG
(
"htc_status (bad)"
);
}
}
}
if
(
hs
==
HTC_S_IDLE
)
{
if
(
hs
==
HTC_S_IDLE
)
{
wrk
->
stats
->
sess_herd
++
;
wrk
->
stats
->
sess_herd
++
;
...
...
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