Method

SoupWebsocketExtensionprocess_incoming_message

Declaration [src]

GBytes*
soup_websocket_extension_process_incoming_message (
  SoupWebsocketExtension* extension,
  guint8* header,
  GBytes* payload,
  GError** error
)

Description [src]

Process a message after it’s received.

If the payload isn’t changed the given payload is just returned, otherwise g_bytes_unref() is called on the given payload and a new GBytes is returned with the new data.

Extensions using reserved bits of the header will reset them in header.

Parameters

header

Type: guint8*

The message header.

The argument will be modified by the function.
payload

Type: GBytes

The payload data.

The instance 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 method 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: GBytes

The message payload data, or NULL in case of error.

The caller of the method takes ownership of the data, and is responsible for freeing it.