summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_application.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
commit16cbf3c076a0aca6d47adaf3f719493674cf2363 (patch)
treee6530480020f62a2bdbf249988ec3e2a751d3927 /src/nxt_application.h
downloadunit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.gz
unit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.bz2
Initial version.
Diffstat (limited to 'src/nxt_application.h')
-rw-r--r--src/nxt_application.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/nxt_application.h b/src/nxt_application.h
new file mode 100644
index 00000000..efbf9c51
--- /dev/null
+++ b/src/nxt_application.h
@@ -0,0 +1,60 @@
+
+/*
+ * Copyright (C) Valentin V. Bartenev
+ * Copyright (C) NGINX, Inc.
+ */
+
+#ifndef _NXT_APPLICATION_H_INCLUDED_
+#define _NXT_APPLICATION_H_INCLUDED_
+
+
+typedef struct {
+ nxt_str_t name;
+ nxt_str_t value;
+} nxt_app_header_field_t;
+
+
+typedef struct {
+ nxt_str_t method;
+ nxt_str_t path;
+ nxt_str_t version;
+ nxt_uint_t fields_num;
+ nxt_app_header_field_t *fields;
+
+ nxt_str_t *content_length;
+ nxt_str_t *content_type;
+} nxt_app_request_header_t;
+
+
+typedef struct {
+ nxt_event_engine_t *engine;
+ nxt_mem_pool_t *mem_pool;
+ nxt_event_conn_t *event_conn;
+ nxt_log_t *log;
+
+ nxt_buf_t *output_buf;
+
+ nxt_app_request_header_t header;
+ nxt_str_t body_preread;
+ off_t body_rest;
+ void *ctx;
+} nxt_app_request_t;
+
+
+typedef struct {
+ nxt_int_t (*init)(nxt_thread_t *thr);
+ nxt_int_t (*start)(nxt_app_request_t *r);
+ nxt_int_t (*header)(nxt_app_request_t *r,
+ nxt_app_header_field_t *field);
+ nxt_int_t (*run)(nxt_app_request_t *r);
+} nxt_application_module_t;
+
+
+extern nxt_application_module_t nxt_python_module;
+
+
+nxt_int_t nxt_app_http_read_body(nxt_app_request_t *r, u_char *data, size_t len);
+nxt_int_t nxt_app_write(nxt_app_request_t *r, const u_char *data, size_t len);
+
+
+#endif /* _NXT_APPLICATION_H_INCLIDED_ */