Commit Graph

7 Commits

Author SHA1 Message Date
Uri Lublin
954eabaeb7 test-websocket: check setsockopt return value
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-06-17 12:48:25 +01:00
Frediano Ziglio
1fbb58ac52 Fix compatibility with SOL_TCP and Darwin
Under Darwin SOL_TCP is not defined. Use IPPROTO_TCP instead.
Other part of SPICE server uses this constant instead already.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-20 15:17:59 +01:00
Frediano Ziglio
32ee52df16 test-websocket: Reuse red_socket_set_non_blocking
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-08-06 13:45:24 +01:00
Frediano Ziglio
5f62d03073 test-websocket: Some Windows compatibility
Don't call close but socket_close.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-08-06 13:45:04 +01:00
Frediano Ziglio
c1c5d8bf5a websocket: Handle continuation and 0-size frames
The WebSocket protocol allows 0-size frames so a returned lenth of
0 does not only mean an issue but it's perfectly expected.
This is also required by WebSocket specification.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-06-26 14:19:13 +01:00
Frediano Ziglio
9d6a438aae websocket: Handle text data
Allows to specify and get frame type.
Type and flags are returned calling websocket_read and returned
calling websocket_write or websocket_writev.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-06-26 14:19:10 +01:00
Frediano Ziglio
975d444f21 test-websocket: Write a test helper to make possible to run Autobahn testsuite
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-06-26 14:19:05 +01:00