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
7074e572
Commit
7074e572
authored
Jul 18, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spiceproxy: code cleanups
parent
d3c2403c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
HTTPServer.pm
PVE/HTTPServer.pm
+16
-16
No files found.
PVE/HTTPServer.pm
View file @
7074e572
...
@@ -503,9 +503,6 @@ sub handle_spice_proxy_request {
...
@@ -503,9 +503,6 @@ sub handle_spice_proxy_request {
print
"
$$: CONNECT
$vmid
,
$node
,
$spiceport
\n
"
if
$self
->
{
debug
};
print
"
$$: CONNECT
$vmid
,
$node
,
$spiceport
\n
"
if
$self
->
{
debug
};
# fixme: use qmp add_client instead?
# fixme: this needs root privs
tcp_connect
"
127.0.0.1
",
$spiceport
,
sub
{
tcp_connect
"
127.0.0.1
",
$spiceport
,
sub
{
my
(
$fh
)
=
@_
my
(
$fh
)
=
@_
or
die
"
connect to 'localhost:
$spiceport
' failed: $!
";
or
die
"
connect to 'localhost:
$spiceport
' failed: $!
";
...
@@ -516,7 +513,6 @@ sub handle_spice_proxy_request {
...
@@ -516,7 +513,6 @@ sub handle_spice_proxy_request {
rbuf_max
=>
64
*
1024
,
rbuf_max
=>
64
*
1024
,
wbuf_max
=>
64
*
10
*
1024
,
wbuf_max
=>
64
*
10
*
1024
,
timeout
=>
0
,
timeout
=>
0
,
#linger => 0, # avoid problems with ssh - really needed ?
on_eof
=>
sub
{
on_eof
=>
sub
{
my
(
$hdl
)
=
@_
;
my
(
$hdl
)
=
@_
;
eval
{
eval
{
...
@@ -532,18 +528,19 @@ sub handle_spice_proxy_request {
...
@@ -532,18 +528,19 @@ sub handle_spice_proxy_request {
$self
->
client_do_disconnect
(
$reqstate
);
$self
->
client_do_disconnect
(
$reqstate
);
};
};
if
(
my
$err
=
$@
)
{
syslog
('
err
',
"
$err
");
}
if
(
my
$err
=
$@
)
{
syslog
('
err
',
"
$err
");
}
},
});
on_read
=>
sub
{
my
(
$hdl
)
=
@_
;
my
$len
=
length
(
$hdl
->
{
rbuf
});
my
$proxyhdlreader
=
sub
{
my
$data
=
substr
(
$hdl
->
{
rbuf
},
0
,
$len
,
'')
;
my
(
$hdl
)
=
@_
;
#print "READ1 $len\n";
my
$len
=
length
(
$hdl
->
{
rbuf
});
$reqstate
->
{
hdl
}
->
push_write
(
$data
)
if
$reqstate
->
{
hdl
};
my
$data
=
substr
(
$hdl
->
{
rbuf
},
0
,
$len
,
'');
});
#print "READ1 $len\n";
$reqstate
->
{
hdl
}
->
on_read
(
sub
{
$reqstate
->
{
hdl
}
->
push_write
(
$data
)
if
$reqstate
->
{
hdl
};
};
my
$hdlreader
=
sub
{
my
(
$hdl
)
=
@_
;
my
(
$hdl
)
=
@_
;
my
$len
=
length
(
$hdl
->
{
rbuf
});
my
$len
=
length
(
$hdl
->
{
rbuf
});
...
@@ -551,11 +548,14 @@ sub handle_spice_proxy_request {
...
@@ -551,11 +548,14 @@ sub handle_spice_proxy_request {
#print "READ0 $len\n";
#print "READ0 $len\n";
$reqstate
->
{
proxyhdl
}
->
push_write
(
$data
)
if
$reqstate
->
{
proxyhdl
};
$reqstate
->
{
proxyhdl
}
->
push_write
(
$data
)
if
$reqstate
->
{
proxyhdl
};
});
};
$reqstate
->
{
proxyhdl
}
->
on_read
(
$proxyhdlreader
);
$reqstate
->
{
hdl
}
->
on_read
(
$hdlreader
);
$reqstate
->
{
hdl
}
->
wbuf_max
(
64
*
10
*
1024
);
$reqstate
->
{
hdl
}
->
wbuf_max
(
64
*
10
*
1024
);
#
fixme
: use stop_read/start_read if write buffer grows to much
#
todo
: use stop_read/start_read if write buffer grows to much
my
$proto
=
$reqstate
->
{
proto
}
?
$reqstate
->
{
proto
}
->
{
str
}
:
'
HTTP/1.0
';
my
$proto
=
$reqstate
->
{
proto
}
?
$reqstate
->
{
proto
}
->
{
str
}
:
'
HTTP/1.0
';
my
$res
=
"
$proto
200 OK
\
015
\
012
";
# hope this is the right answer?
my
$res
=
"
$proto
200 OK
\
015
\
012
";
# hope this is the right answer?
...
...
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