Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
56cf829b
Commit
56cf829b
authored
Jan 01, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spiceproxy: keep socket open on restart
parent
01b3b6ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
spiceproxy
bin/spiceproxy
+31
-11
No files found.
bin/spiceproxy
View file @
56cf829b
...
@@ -61,17 +61,37 @@ sub init {
...
@@ -61,17 +61,37 @@ sub init {
my
$lockfh
=
IO::
File
->
new
("
>>
${accept_lock_fn}
")
||
my
$lockfh
=
IO::
File
->
new
("
>>
${accept_lock_fn}
")
||
die
"
unable to open lock file '
${accept_lock_fn}
' - $!
\n
";
die
"
unable to open lock file '
${accept_lock_fn}
' - $!
\n
";
my
$socket
=
IO::Socket::
INET
->
new
(
my
(
$socket
,
$sockfd
);
LocalAddr
=>
undef
,
# all interfaces
LocalPort
=>
3128
,
if
(
defined
(
$sockfd
=
$ENV
{
PVE_DAEMON_SOCKET_3128
})
&&
Listen
=>
SOMAXCONN
,
$self
->
{
env_restart_pve_daemon
})
{
Proto
=>
'
tcp
',
ReuseAddr
=>
1
)
||
die
"
unable to parse socket fd '
$sockfd
'
\n
"
die
"
unable to create socket - $@
\n
";
if
$sockfd
!~
m/^(\d+)$/
;
$sockfd
=
$1
;
# untaint
# we often observe delays when using Nagle algorithm,
# so we disable that to maximize performance
$socket
=
IO::Socket::
INET
->
new
;
setsockopt
(
$socket
,
IPPROTO_TCP
,
TCP_NODELAY
,
1
);
$socket
->
fdopen
(
$sockfd
,
'
w
')
||
die
"
cannot fdopen file descriptor '
$sockfd
' - $!
\n
";
}
else
{
$socket
=
IO::Socket::
INET
->
new
(
LocalAddr
=>
undef
,
# all interfaces
LocalPort
=>
3128
,
Listen
=>
SOMAXCONN
,
Proto
=>
'
tcp
',
ReuseAddr
=>
1
)
||
die
"
unable to create socket - $@
\n
";
# we often observe delays when using Nagle algorithm,
# so we disable that to maximize performance
setsockopt
(
$socket
,
IPPROTO_TCP
,
TCP_NODELAY
,
1
);
$ENV
{
PVE_DAEMON_SOCKET_3128
}
=
$socket
->
fileno
;
}
# remove FD_CLOEXEC bit to reuse on exec
$socket
->
fcntl
(
Fcntl::
F_SETFD
(),
0
);
$self
->
{
server_config
}
=
{
$self
->
{
server_config
}
=
{
base_handler_class
=>
'
PVE::API2
',
base_handler_class
=>
'
PVE::API2
',
...
...
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