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
8d6c4a1b
Commit
8d6c4a1b
authored
Jan 15, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The rest of previous commit.
parent
45d4464d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
48 deletions
+21
-48
cache_acceptor.c
bin/varnishd/cache/cache_acceptor.c
+1
-6
cache_session.c
bin/varnishd/cache/cache_session.c
+1
-4
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+17
-36
vtcp.h
include/vtcp.h
+2
-2
No files found.
bin/varnishd/cache/cache_acceptor.c
View file @
8d6c4a1b
...
...
@@ -368,12 +368,7 @@ vca_make_session(struct worker *wrk, void *arg)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CAST_OBJ_NOTNULL
(
wa
,
arg
,
WRK_ACCEPT_MAGIC
);
if
(
VTCP_blocking
(
wa
->
acceptsock
))
{
closefd
(
&
wa
->
acceptsock
);
wrk
->
stats
->
sess_drop
++
;
// XXX Better counter ?
WS_Release
(
wrk
->
aws
,
0
);
return
;
}
VTCP_blocking
(
wa
->
acceptsock
);
/* Turn accepted socket into a session */
AN
(
wrk
->
aws
->
r
);
...
...
bin/varnishd/cache/cache_session.c
View file @
8d6c4a1b
...
...
@@ -440,10 +440,7 @@ SES_Wait(struct sess *sp, const struct transport *xp)
* XXX: waiter_epoll prevents us from zeroing the struct because
* XXX: it keeps state across calls.
*/
if
(
VTCP_nonblocking
(
sp
->
fd
))
{
SES_Delete
(
sp
,
SC_REM_CLOSE
,
NAN
);
return
;
}
VTCP_nonblocking
(
sp
->
fd
);
/*
* put struct waited on the workspace
...
...
bin/varnishd/http1/cache_http1_fsm.c
View file @
8d6c4a1b
...
...
@@ -176,30 +176,6 @@ http1_req_fail(struct req *req, enum sess_close reason)
SES_Close
(
req
->
sp
,
reason
);
}
/*----------------------------------------------------------------------
*/
static
int
http1_req_cleanup
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
{
AZ
(
wrk
->
aws
->
r
);
AZ
(
req
->
ws
->
r
);
Req_Cleanup
(
sp
,
wrk
,
req
);
if
(
sp
->
fd
>=
0
&&
req
->
doclose
!=
SC_NULL
)
SES_Close
(
sp
,
req
->
doclose
);
if
(
sp
->
fd
<
0
)
{
wrk
->
stats
->
sess_closed
++
;
AZ
(
req
->
vcl
);
Req_Release
(
req
);
SES_Delete
(
sp
,
SC_NULL
,
NAN
);
return
(
1
);
}
return
(
0
);
}
static
int
v_matchproto_
(
vtr_minimal_response_f
)
http1_minimal_response
(
struct
req
*
req
,
uint16_t
status
)
{
...
...
@@ -336,18 +312,9 @@ HTTP1_Session(struct worker *wrk, struct req *req)
* Whenever we come in from the acceptor or waiter, we need to set
* blocking mode. It would be simpler to do this in the acceptor
* or waiter, but we'd rather do the syscall in the worker thread.
* On systems which return errors for ioctl, we close early
*/
if
(
http1_getstate
(
sp
)
==
H1NEWREQ
&&
VTCP_blocking
(
sp
->
fd
))
{
AN
(
req
->
htc
->
ws
->
r
);
if
(
errno
==
ECONNRESET
)
SES_Close
(
sp
,
SC_REM_CLOSE
);
else
SES_Close
(
sp
,
SC_TX_ERROR
);
WS_Release
(
req
->
htc
->
ws
,
0
);
AN
(
http1_req_cleanup
(
sp
,
wrk
,
req
));
return
;
}
if
(
http1_getstate
(
sp
)
==
H1NEWREQ
)
VTCP_blocking
(
sp
->
fd
);
req
->
transport
=
&
HTTP1_transport
;
...
...
@@ -454,8 +421,22 @@ HTTP1_Session(struct worker *wrk, struct req *req)
AZ
(
wrk
->
aws
->
r
);
http1_setstate
(
sp
,
H1CLEANUP
);
}
else
if
(
st
==
H1CLEANUP
)
{
if
(
http1_req_cleanup
(
sp
,
wrk
,
req
))
AZ
(
wrk
->
aws
->
r
);
AZ
(
req
->
ws
->
r
);
if
(
sp
->
fd
>=
0
&&
req
->
doclose
!=
SC_NULL
)
SES_Close
(
sp
,
req
->
doclose
);
if
(
sp
->
fd
<
0
)
{
wrk
->
stats
->
sess_closed
++
;
Req_Cleanup
(
sp
,
wrk
,
req
);
Req_Release
(
req
);
SES_Delete
(
sp
,
SC_NULL
,
NAN
);
return
;
}
Req_Cleanup
(
sp
,
wrk
,
req
);
HTC_RxInit
(
req
->
htc
,
req
->
ws
);
if
(
req
->
htc
->
rxbuf_e
!=
req
->
htc
->
rxbuf_b
)
wrk
->
stats
->
sess_readahead
++
;
...
...
include/vtcp.h
View file @
8d6c4a1b
...
...
@@ -45,8 +45,8 @@ void VTCP_hisname(int sock, char *abuf, unsigned alen,
char
*
pbuf
,
unsigned
plen
);
int
VTCP_filter_http
(
int
sock
);
int
VTCP_fastopen
(
int
sock
,
int
depth
);
int
VTCP_blocking
(
int
sock
);
int
VTCP_nonblocking
(
int
sock
);
void
VTCP_blocking
(
int
sock
);
void
VTCP_nonblocking
(
int
sock
);
int
VTCP_linger
(
int
sock
,
int
linger
);
int
VTCP_check_hup
(
int
sock
);
...
...
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