summaryrefslogtreecommitdiff
path: root/event-httpd.h
blob: 7818bd5028049fe249ed7c7e14cbdf4007e40e1a (plain)
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
// Copyright (C) 2021 Russell King.
// Licensed under GPL version 2. See COPYING.
#ifndef MINI_HTTPD_H
#define MINI_HTTPD_H

struct client {
	GSocketConnection *conn;
	GDataInputStream *data;
	GOutputStream *out;
	GInputStream *in;

	gboolean forwarded;
	gboolean can_chunk;
	char *request;
	char *uri;
	char *query;
	char *version;

	struct resource *resource;
	void *resource_data;
};

void close_client(struct client *c);
void respond_header(struct client *c, int error_code, const char *reason,
		    const char *headers);
void respond_chunk(struct client *c, GString *s);

#endif