summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2014-07-13 15:11:23 +0000
committerreyk <reyk@openbsd.org>2014-07-13 15:11:23 +0000
commitfb419eef0acd15faac2d2fbd3d42d41cbfceec52 (patch)
tree360e7369d2f0cf0f80e2378e1814b765f47630f2
parentFinish writing the output before closing the connection (diff)
downloadwireguard-openbsd-fb419eef0acd15faac2d2fbd3d42d41cbfceec52.tar.xz
wireguard-openbsd-fb419eef0acd15faac2d2fbd3d42d41cbfceec52.zip
Sync file to be identical in relayd(8) and httpd(8).
-rw-r--r--usr.sbin/httpd/http.h11
-rw-r--r--usr.sbin/relayd/http.h26
2 files changed, 29 insertions, 8 deletions
diff --git a/usr.sbin/httpd/http.h b/usr.sbin/httpd/http.h
index 46273b7a18b..af2627f6d2e 100644
--- a/usr.sbin/httpd/http.h
+++ b/usr.sbin/httpd/http.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.h,v 1.2 2014/07/13 14:17:37 reyk Exp $ */
+/* $OpenBSD: http.h,v 1.3 2014/07/13 15:11:23 reyk Exp $ */
/*
* Copyright (c) 2012 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -16,8 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef _HTTPD_HTTP_H
-#define _HTTPD_HTTP_H
+#ifndef _HTTP_H
+#define _HTTP_H
enum httpmethod {
HTTP_METHOD_NONE = 0,
@@ -140,10 +140,13 @@ struct http_mediatype {
/* Used during runtime */
struct http_descriptor {
struct kv http_pathquery;
+ struct kv http_matchquery;
#define http_path http_pathquery.kv_key
#define http_query http_pathquery.kv_value
#define http_rescode http_pathquery.kv_key
#define http_resmesg http_pathquery.kv_value
+#define query_key http_matchquery.kv_key
+#define query_val http_matchquery.kv_value
char *http_version;
enum httpmethod http_method;
@@ -154,4 +157,4 @@ struct http_descriptor {
struct kv *http_lastheader;
};
-#endif /* _HTTPD_HTTP_H */
+#endif /* _HTTP_H */
diff --git a/usr.sbin/relayd/http.h b/usr.sbin/relayd/http.h
index 69343cbb7c1..80f4f4ff218 100644
--- a/usr.sbin/relayd/http.h
+++ b/usr.sbin/relayd/http.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.h,v 1.3 2014/07/12 14:34:13 reyk Exp $ */
+/* $OpenBSD: http.h,v 1.4 2014/07/13 15:11:23 reyk Exp $ */
/*
* Copyright (c) 2012 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -16,8 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef _RELAYD_HTTP_H
-#define _RELAYD_HTTP_H
+#ifndef _HTTP_H
+#define _HTTP_H
enum httpmethod {
HTTP_METHOD_NONE = 0,
@@ -119,6 +119,24 @@ struct http_error {
{ 0, NULL } \
}
+struct http_mediatype {
+ char *media_name;
+ char *media_type;
+ char *media_subtype;
+};
+/* Some default media types */
+#define MEDIA_TYPES { \
+ { "css", "text", "css" }, \
+ { "html", "text", "html" }, \
+ { "txt", "text", "plain" }, \
+ { "gif", "image", "gif" }, \
+ { "jpeg", "image", "jpeg" }, \
+ { "jpg", "image", "jpeg" }, \
+ { "png", "image", "png" }, \
+ { "js", "application", "javascript" }, \
+ { NULL } \
+}
+
/* Used during runtime */
struct http_descriptor {
struct kv http_pathquery;
@@ -139,4 +157,4 @@ struct http_descriptor {
struct kv *http_lastheader;
};
-#endif /* _RELAYD_HTTP_H */
+#endif /* _HTTP_H */