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
bd765420
Commit
bd765420
authored
Dec 23, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collapse two functions for clarity
parent
2c90d787
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
27 deletions
+16
-27
cache_acceptor.c
bin/varnishd/cache/cache_acceptor.c
+16
-27
No files found.
bin/varnishd/cache/cache_acceptor.c
View file @
bd765420
...
...
@@ -127,32 +127,6 @@ sock_test(int fd)
need_test
=
0
;
}
/*--------------------------------------------------------------------
* Called once the workerthread gets hold of the session, to fix up
* any socket options that need it.
*/
static
void
vca_prep
(
const
struct
sess
*
sp
)
{
if
(
need_test
)
sock_test
(
sp
->
fd
);
if
(
need_linger
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
linger
,
sizeof
linger
));
#ifdef SO_SNDTIMEO_WORKS
if
(
need_sndtimeo
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_SNDTIMEO
,
&
tv_sndtimeo
,
sizeof
tv_sndtimeo
));
#endif
#ifdef SO_RCVTIMEO_WORKS
if
(
need_rcvtimeo
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_RCVTIMEO
,
&
tv_rcvtimeo
,
sizeof
tv_rcvtimeo
));
#endif
}
/*--------------------------------------------------------------------
* If accept(2)'ing fails, we pace ourselves to relive any resource
* shortage if possible.
...
...
@@ -285,7 +259,22 @@ VCA_SetupSess(struct worker *w)
sp
->
sockaddrlen
=
wa
->
acceptaddrlen
;
vca_pace_good
();
w
->
stats
.
sess_conn
++
;
vca_prep
(
sp
);
if
(
need_test
)
sock_test
(
sp
->
fd
);
if
(
need_linger
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
linger
,
sizeof
linger
));
#ifdef SO_SNDTIMEO_WORKS
if
(
need_sndtimeo
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_SNDTIMEO
,
&
tv_sndtimeo
,
sizeof
tv_sndtimeo
));
#endif
#ifdef SO_RCVTIMEO_WORKS
if
(
need_rcvtimeo
)
VTCP_Assert
(
setsockopt
(
sp
->
fd
,
SOL_SOCKET
,
SO_RCVTIMEO
,
&
tv_rcvtimeo
,
sizeof
tv_rcvtimeo
));
#endif
}
/*--------------------------------------------------------------------*/
...
...
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