Function

Soupwebsocket_client_verify_handshake

Declaration [src]

gboolean
soup_websocket_client_verify_handshake (
  SoupMessage* msg,
  GPtrArray* supported_extensions,
  GList** accepted_extensions,
  GError** error
)

Description [src]

Looks at the response status code and headers in msg and determines if they contain a valid WebSocket handshake response (given the handshake request in msgs request headers).

If supported_extensions is non-NULL, extensions included in the response “Sec-WebSocket-Extensions” are verified too. Accepted extensions are returned in accepted_extensions parameter if non-NULL.

This is a low-level function; if you use soup_session_websocket_connect_async() to create a WebSocket connection, it will call this for you.

Parameters

msg

Type: SoupMessage

SoupMessage containing both client and server sides of a WebSocket handshake.

The data is owned by the caller of the function.
supported_extensions

Type: An array of None

List of supported extension types.

The argument can be NULL.
The data is owned by the caller of the function.
accepted_extensions

Type: A list of None

A GList of SoupWebsocketExtension objects.

The argument will be set by the function.
The argument can be NULL.
The called function takes ownership of the data, and is responsible for freeing it.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if msg contains a completed valid WebSocket handshake, FALSE and an error if not.