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
9633e660
Commit
9633e660
authored
Dec 05, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Led VDI_CloseFd() take an the vbc to be closed as argument.
parent
9a5b4779
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
23 deletions
+27
-23
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+3
-3
cache_dir.c
bin/varnishd/cache/cache_dir.c
+14
-10
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+7
-7
cache_pipe.c
bin/varnishd/cache/cache_pipe.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
9633e660
...
...
@@ -650,7 +650,7 @@ void VBE_UseHealth(const struct director *vdi);
struct
vbc
*
VDI_GetFd
(
const
struct
director
*
,
struct
sess
*
sp
);
int
VDI_Healthy
(
const
struct
director
*
,
const
struct
sess
*
sp
);
void
VDI_CloseFd
(
struct
worker
*
wrk
);
void
VDI_CloseFd
(
struct
worker
*
wrk
,
struct
vbc
**
vbp
);
void
VDI_RecycleFd
(
struct
worker
*
wrk
);
void
VDI_AddHostHeader
(
const
struct
sess
*
sp
);
void
VBE_Poll
(
void
);
...
...
bin/varnishd/cache/cache_center.c
View file @
9633e660
...
...
@@ -249,7 +249,7 @@ cnt_prepresp(struct sess *sp)
if
(
sp
->
restarts
>=
cache_param
->
max_restarts
)
break
;
if
(
wrk
->
busyobj
->
do_stream
)
{
VDI_CloseFd
(
wrk
);
VDI_CloseFd
(
wrk
,
&
wrk
->
vbc
);
HSH_Drop
(
wrk
);
}
else
{
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
wrk
->
obj
);
...
...
@@ -633,7 +633,7 @@ cnt_fetch(struct sess *sp)
}
/* We are not going to fetch the body, Close the connection */
VDI_CloseFd
(
wrk
);
VDI_CloseFd
(
wrk
,
&
wrk
->
vbc
);
}
/* Clean up partial fetch */
...
...
@@ -817,7 +817,7 @@ cnt_fetchbody(struct sess *sp)
if
(
wrk
->
obj
==
NULL
)
{
sp
->
err_code
=
503
;
sp
->
step
=
STP_ERROR
;
VDI_CloseFd
(
wrk
);
VDI_CloseFd
(
wrk
,
&
wrk
->
vbc
);
return
(
0
);
}
CHECK_OBJ_NOTNULL
(
wrk
->
obj
,
OBJECT_MAGIC
);
...
...
bin/varnishd/cache/cache_dir.c
View file @
9633e660
...
...
@@ -40,27 +40,31 @@
/* Close a connection ------------------------------------------------*/
void
VDI_CloseFd
(
struct
worker
*
wrk
)
VDI_CloseFd
(
struct
worker
*
wrk
,
struct
vbc
**
vbp
)
{
struct
backend
*
bp
;
struct
vbc
*
vc
;
CHECK_OBJ_NOTNULL
(
wrk
->
vbc
,
VBC_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
->
vbc
->
backend
,
BACKEND_MAGIC
);
assert
(
wrk
->
vbc
->
fd
>=
0
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
AN
(
vbp
);
vc
=
*
vbp
;
*
vbp
=
NULL
;
CHECK_OBJ_NOTNULL
(
vc
,
VBC_MAGIC
);
CHECK_OBJ_NOTNULL
(
vc
->
backend
,
BACKEND_MAGIC
);
assert
(
vc
->
fd
>=
0
);
bp
=
wrk
->
vb
c
->
backend
;
bp
=
v
c
->
backend
;
WSL
(
wrk
,
SLT_BackendClose
,
wrk
->
vb
c
->
vsl_id
,
"%s"
,
bp
->
display_name
);
WSL
(
wrk
,
SLT_BackendClose
,
v
c
->
vsl_id
,
"%s"
,
bp
->
display_name
);
/* Checkpoint log to flush all info related to this connection
before the OS reuses the FD */
WSL_Flush
(
wrk
,
0
);
VTCP_close
(
&
wrk
->
vb
c
->
fd
);
VTCP_close
(
&
v
c
->
fd
);
VBE_DropRefConn
(
bp
);
wrk
->
vbc
->
backend
=
NULL
;
VBE_ReleaseConn
(
wrk
->
vbc
);
wrk
->
vbc
=
NULL
;
vc
->
backend
=
NULL
;
VBE_ReleaseConn
(
vc
);
}
/* Recycle a connection ----------------------------------------------*/
...
...
bin/varnishd/cache/cache_fetch.c
View file @
9633e660
...
...
@@ -427,7 +427,7 @@ FetchHdr(struct sess *sp)
if
(
WRW_FlushRelease
(
w
)
||
i
>
0
)
{
WSP
(
sp
,
SLT_FetchError
,
"backend write error: %d (%s)"
,
errno
,
strerror
(
errno
));
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
/* XXX: other cleanup ? */
return
(
retry
);
}
...
...
@@ -451,7 +451,7 @@ FetchHdr(struct sess *sp)
if
(
i
<
0
)
{
WSP
(
sp
,
SLT_FetchError
,
"http first read error: %d %d (%s)"
,
i
,
errno
,
strerror
(
errno
));
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
/* XXX: other cleanup ? */
/* Retryable if we never received anything */
return
(
i
==
-
1
?
retry
:
-
1
);
...
...
@@ -465,7 +465,7 @@ FetchHdr(struct sess *sp)
WSP
(
sp
,
SLT_FetchError
,
"http first read error: %d %d (%s)"
,
i
,
errno
,
strerror
(
errno
));
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
/* XXX: other cleanup ? */
return
(
-
1
);
}
...
...
@@ -475,7 +475,7 @@ FetchHdr(struct sess *sp)
if
(
http_DissectResponse
(
w
,
htc
,
hp
))
{
WSP
(
sp
,
SLT_FetchError
,
"http format error"
);
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
/* XXX: other cleanup ? */
return
(
-
1
);
}
...
...
@@ -571,7 +571,7 @@ FetchBody(struct worker *w, struct object *obj)
cls
,
mklen
);
if
(
w
->
busyobj
->
body_status
==
BS_ERROR
)
{
VDI_CloseFd
(
w
);
VDI_CloseFd
(
w
,
&
w
->
vbc
);
return
(
__LINE__
);
}
...
...
@@ -583,7 +583,7 @@ FetchBody(struct worker *w, struct object *obj)
VTAILQ_REMOVE
(
&
obj
->
store
,
st
,
list
);
STV_free
(
st
);
}
VDI_CloseFd
(
w
);
VDI_CloseFd
(
w
,
&
w
->
vbc
);
obj
->
len
=
0
;
return
(
__LINE__
);
}
...
...
@@ -616,7 +616,7 @@ FetchBody(struct worker *w, struct object *obj)
}
if
(
cls
)
VDI_CloseFd
(
w
);
VDI_CloseFd
(
w
,
&
w
->
vbc
);
else
VDI_RecycleFd
(
w
);
...
...
bin/varnishd/cache/cache_pipe.c
View file @
9633e660
...
...
@@ -89,7 +89,7 @@ PipeSession(struct sess *sp)
if
(
i
)
{
SES_Close
(
sp
,
"pipe"
);
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
return
;
}
...
...
@@ -129,5 +129,5 @@ PipeSession(struct sess *sp)
}
}
SES_Close
(
sp
,
"pipe"
);
VDI_CloseFd
(
sp
->
wrk
);
VDI_CloseFd
(
sp
->
wrk
,
&
sp
->
wrk
->
vbc
);
}
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