| 1 |
/* |
| 2 |
* Copyright (C) 2013 Red Hat, Inc. |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef __WEB_SOCKET_PRIVATE_H__ |
| 7 |
#define __WEB_SOCKET_PRIVATE_H__ |
| 8 |
|
| 9 |
#include <gio/gio.h> |
| 10 |
|
| 11 |
G_BEGIN_DECLS |
| 12 |
|
| 13 |
gboolean _web_socket_util_parse_url (const gchar *url, |
| 14 |
gchar **out_scheme, |
| 15 |
gchar **out_host, |
| 16 |
gchar **out_path, |
| 17 |
GError **error); |
| 18 |
|
| 19 |
gboolean _web_socket_util_header_equals (GHashTable *headers, |
| 20 |
const gchar *name, |
| 21 |
const gchar *want); |
| 22 |
|
| 23 |
gboolean _web_socket_util_header_contains (GHashTable *headers, |
| 24 |
const gchar *name, |
| 25 |
const gchar *word); |
| 26 |
|
| 27 |
gboolean _web_socket_util_header_empty (GHashTable *headers, |
| 28 |
const gchar *name); |
| 29 |
|
| 30 |
typedef enum { |
| 31 |
WEB_SOCKET_QUEUE_NORMAL = 0, |
| 32 |
WEB_SOCKET_QUEUE_URGENT = 1 << 0, |
| 33 |
WEB_SOCKET_QUEUE_LAST = 1 << 1, |
| 34 |
} WebSocketQueueFlags; |
| 35 |
|
| 36 |
void _web_socket_connection_queue (WebSocketConnection *conn, |
| 37 |
WebSocketQueueFlags flags, |
| 38 |
gpointer frame, |
| 39 |
gsize length, |
| 40 |
gsize buffered_amount); |
| 41 |
|
| 42 |
GMainContext * _web_socket_connection_get_main_context (WebSocketConnection *self); |
| 43 |
|
| 44 |
gboolean _web_socket_connection_error (WebSocketConnection *self, |
| 45 |
GError *error); |
| 46 |
|
| 47 |
void _web_socket_connection_error_and_close (WebSocketConnection *self, |
| 48 |
GError *error, |
| 49 |
gboolean prejudice); |
| 50 |
|
| 51 |
void _web_socket_connection_take_io_stream (WebSocketConnection *self, |
| 52 |
GIOStream *io_stream); |
| 53 |
|
| 54 |
void _web_socket_connection_take_incoming (WebSocketConnection *self, |
| 55 |
GByteArray *input_buffer); |
| 56 |
|
| 57 |
gboolean _web_socket_connection_choose_protocol (WebSocketConnection *self, |
| 58 |
const gchar **protocols, |
| 59 |
const gchar *value); |
| 60 |
|
| 61 |
gchar * _web_socket_complete_accept_key_rfc6455 (const gchar *key); |
| 62 |
|
| 63 |
G_END_DECLS |
| 64 |
|
| 65 |
#endif /* __WEB_SOCKET_PRIVATE_H__ */ |