File: websocket.h

package info (click to toggle)
webdis 0.1.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 580 kB
  • sloc: ansic: 5,250; sh: 254; python: 247; makefile: 90
file content (30 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef WEBSOCKET_H
#define WEBSOCKET_H

#include <stdlib.h>
#include <stdint.h>

struct http_client;
struct cmd;

enum ws_state {
	WS_ERROR,
	WS_READING,
	WS_MSG_COMPLETE};

struct ws_msg {
	char *payload;
	size_t payload_sz;
	size_t total_sz;
};

int
ws_handshake_reply(struct http_client *c);

enum ws_state
ws_add_data(struct http_client *c);

int
ws_reply(struct cmd *cmd, const char *p, size_t sz);

#endif