Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
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
rasky
libvncserver
Commits
4d9178dc
Commit
4d9178dc
authored
Jan 12, 2012
by
Gernot Tenchio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websockets: restore errno after logging an error
parent
9e090406
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
websockets.c
libvncserver/websockets.c
+17
-6
No files found.
libvncserver/websockets.c
View file @
4d9178dc
...
@@ -527,7 +527,10 @@ webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len)
...
@@ -527,7 +527,10 @@ webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len)
n
=
ws_peek
(
cl
,
buf
,
len
*
2
+
2
);
n
=
ws_peek
(
cl
,
buf
,
len
*
2
+
2
);
if
(
n
<=
0
)
{
if
(
n
<=
0
)
{
/* save errno because rfbErr() will tamper it */
int
olderrno
=
errno
;
rfbErr
(
"%s: peek (%d) %m
\n
"
,
__func__
,
errno
);
rfbErr
(
"%s: peek (%d) %m
\n
"
,
__func__
,
errno
);
errno
=
olderrno
;
return
n
;
return
n
;
}
}
...
@@ -642,14 +645,20 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
...
@@ -642,14 +645,20 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
buf
=
wsctx
->
codeBuf
;
buf
=
wsctx
->
codeBuf
;
header
=
(
ws_header_t
*
)
wsctx
->
codeBuf
;
header
=
(
ws_header_t
*
)
wsctx
->
codeBuf
;
if
(
-
1
==
(
ret
=
ws_peek
(
cl
,
buf
,
B64LEN
(
len
)
+
WSHLENMAX
)))
{
ret
=
ws_peek
(
cl
,
buf
,
B64LEN
(
len
)
+
WSHLENMAX
);
rfbErr
(
"%s: peek; %m
\n
"
,
__func__
);
goto
spor
;
}
if
(
ret
<
2
)
{
if
(
ret
<
2
)
{
rfbErr
(
"%s: peek; got %d bytes
\n
"
,
__func__
,
ret
);
/* save errno because rfbErr() will tamper it */
goto
spor
;
/* Incomplete frame header */
if
(
-
1
==
ret
)
{
int
olderrno
=
errno
;
rfbErr
(
"%s: peek; %m
\n
"
,
__func__
);
errno
=
olderrno
;
}
else
if
(
0
==
ret
)
{
result
=
0
;
}
else
{
errno
=
EAGAIN
;
}
goto
spor
;
}
}
opcode
=
header
->
b0
&
0x0f
;
opcode
=
header
->
b0
&
0x0f
;
...
@@ -691,7 +700,9 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
...
@@ -691,7 +700,9 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
payload
=
buf
+
fhlen
+
4
;
/* header length + mask */
payload
=
buf
+
fhlen
+
4
;
/* header length + mask */
if
(
-
1
==
(
ret
=
ws_read
(
cl
,
buf
,
total
)))
{
if
(
-
1
==
(
ret
=
ws_read
(
cl
,
buf
,
total
)))
{
int
olderrno
=
errno
;
rfbErr
(
"%s: read; %m"
,
__func__
);
rfbErr
(
"%s: read; %m"
,
__func__
);
errno
=
olderrno
;
return
ret
;
return
ret
;
}
else
if
(
ret
<
total
)
{
}
else
if
(
ret
<
total
)
{
/* GT TODO: hmm? */
/* GT TODO: hmm? */
...
...
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