summaryrefslogtreecommitdiff
path: root/event-httpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'event-httpd.h')
-rw-r--r--event-httpd.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/event-httpd.h b/event-httpd.h
new file mode 100644
index 0000000..7818bd5
--- /dev/null
+++ b/event-httpd.h
@@ -0,0 +1,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