mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
vnc: reorganize code for reverse mode
Avoid the dance between csock and vs->lsock. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1ce52c78ab
commit
007fcd3ee9
3 changed files with 12 additions and 16 deletions
20
ui/vnc.c
20
ui/vnc.c
|
@ -3053,19 +3053,17 @@ int vnc_display_open(DisplayState *ds, const char *display)
|
|||
|
||||
if (reverse) {
|
||||
/* connect to viewer */
|
||||
if (strncmp(display, "unix:", 5) == 0)
|
||||
vs->lsock = unix_connect(display+5, NULL);
|
||||
else
|
||||
vs->lsock = inet_connect(display, NULL);
|
||||
if (vs->lsock < 0) {
|
||||
goto fail;
|
||||
int csock;
|
||||
vs->lsock = -1;
|
||||
if (strncmp(display, "unix:", 5) == 0) {
|
||||
csock = unix_connect(display+5, NULL);
|
||||
} else {
|
||||
int csock = vs->lsock;
|
||||
vs->lsock = -1;
|
||||
vnc_connect(vs, csock, 0);
|
||||
csock = inet_connect(display, NULL);
|
||||
}
|
||||
return 0;
|
||||
|
||||
if (csock < 0) {
|
||||
goto fail;
|
||||
}
|
||||
vnc_connect(vs, csock, 0);
|
||||
} else {
|
||||
/* listen for connects */
|
||||
char *dpy;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue