Max Romanov
b53b7b0413
Build on Solaris 11 fixed.
2017-06-26 19:58:43 +03:00
Valentin Bartenev
9399a04121
Configuration printing functions splitted in two parts.
...
Requested by Igor.
2017-06-23 23:28:37 +03:00
Valentin Bartenev
72429410f7
Renames and reordering of parameters in configuration parser functions.
...
Requested by Igor.
2017-06-23 20:54:07 +03:00
Max Romanov
83088a0f4b
Incoming and outgoing port_mmap arrays are protected with mutexes.
2017-06-23 19:20:08 +03:00
Max Romanov
abe0d33329
Increased size of iovec when data passed using shared memory.
...
Useful for tiny shared memory segment test case.
2017-06-23 19:20:08 +03:00
Max Romanov
b8f126dcdf
Added basic HTTP request processing in router.
...
- request to connection mapping in engine;
- requests queue in connection;
- engine port creation;
- connected ports hash for each process;
- engine port data messages processing (app responses);
2017-06-23 19:20:08 +03:00
Max Romanov
4a1b59c27a
External Go app request processing.
2017-06-23 19:20:08 +03:00
Max Romanov
5a43bd0bfd
PHP app request processing.
2017-06-23 19:20:08 +03:00
Max Romanov
fa6582d9ad
Python app request processing.
2017-06-23 19:20:08 +03:00
Max Romanov
e7a0634a71
Application-side message processing.
...
Usage on the router side:
nxt_app_wmsg_t wmsg;
nxt_app_parse_ctx_t parse_ctx;
nxt_app_http_req_init(task, &parse_ctx);
/* parse incoming request data */
if (nxt_app_http_req_parse(task, &parse_ctx, buf) == NXT_DONE) {
/* choose app */
nxt_app = nxt_select_app(... &parse_ctx.r ...);
/* find port */
wmsg.port = nxt_get_app_port(... nxt_app ...);
wmsg.buf = &wmsg.write;
/* fill write message buffer in shared mem */
nxt_app->prepare_msg(task, &parse_ctx.r, &wmsg);
/* send message to app for processing */
nxt_port_socket_write(task, wmsg.port, NXT_PORT_MSG_DATA,
-1, 0, 0, wmsg.write);
}
2017-06-23 19:20:08 +03:00
Max Romanov
3b9aa27625
Added mem_pool pointer member to nxt_port_send_msg_t.
...
To decouple nxt_port_send_msg_t from port.
2017-06-23 19:20:08 +03:00
Max Romanov
eaf28db46e
Moved message size to nxt_port_recv_msg_t for convenience.
2017-06-23 19:20:08 +03:00
Max Romanov
3e989a165c
Extruded nxt_port_send_port() to send port to one process.
2017-06-23 19:20:08 +03:00
Max Romanov
0cd9521687
Store pointer to shared memory start in buf->parent.
...
nxt_port_mmap_t stored in arrays and it is unsafe to store
pointer to array element.
Shared memory structures and macros moved to separate header
file to be used by GO package.
2017-06-23 19:20:04 +03:00
Max Romanov
b13cdb0faa
Store mem_pool in buf->data instead of port for consistency.
2017-06-23 19:19:41 +03:00
Max Romanov
ac43bfcc72
nxt_process_create() changed to add process to runtime before callbacks.
2017-06-23 19:19:41 +03:00
Max Romanov
e5fe254e1e
nxt_port_create() use task instead of thread.
...
Write socket close() call moved out from nxt_port_create().
2017-06-23 19:19:41 +03:00
Max Romanov
89ab9a9d05
Shorter shared memory name generated.
2017-06-23 19:19:41 +03:00
Max Romanov
0fdcdde6c8
lvlhash for ports moved to separate files for future re-use.
2017-06-23 19:19:41 +03:00
Max Romanov
58e20da984
Runtime ports fix, add enumeration macros.
2017-06-23 19:19:41 +03:00
Valentin Bartenev
fa94dc7782
Configuration: fixed parsing of JSON literals.
2017-06-23 17:35:06 +03:00
Igor Sysoev
3fcda23f15
Style and comment fixes.
2017-06-23 13:28:39 +03:00
Valentin Bartenev
9593ce769a
Removed surplus type casting from nxt_memcmp() calls.
2017-06-21 22:45:20 +03:00
Valentin Bartenev
58e24662da
Fixed building by GCC 4.8 and older.
2017-06-21 22:35:41 +03:00
Igor Sysoev
5e73d93999
Optimizations in nxt_mp_create().
2017-06-21 10:21:06 +03:00
Igor Sysoev
d59e906c01
Fixed building with -DNXT_DEBUG_MEMORY=1 (broken in 10688b89aa16).
2017-06-21 10:20:41 +03:00
Valentin Bartenev
accb489492
HTTP parser: reduced memory consumption of header fields list.
2017-06-20 22:32:13 +03:00
Igor Sysoev
1a22195830
Fixed errors in the previous changeset.
2017-06-20 19:59:12 +03:00
Igor Sysoev
f888a5310c
Using new memory pool implementation.
2017-06-20 19:49:17 +03:00
Igor Sysoev
c7ab908c19
Fixed error in the previous changeset.
2017-06-20 13:56:28 +03:00
Igor Sysoev
b1b9f621a4
Memory pools refactoring.
2017-06-19 16:26:19 +03:00
Igor Sysoev
7574c64992
nxt_event_conn_... functions and structures have been renamed
...
to nxt_conn_...
2017-06-14 15:18:52 +03:00
Igor Sysoev
3e2632688f
Router: follow up to HTTP parser changes.
2017-06-14 15:18:43 +03:00
Valentin Bartenev
db6642f374
HTTP parser: decoupled header fields processing.
2017-06-13 20:11:29 +03:00
Valentin Bartenev
f6e7c2b6a6
HTTP parser: fixed handling header fields with missing colon.
2017-06-09 21:49:51 +03:00
Valentin Bartenev
c5cd7e5e97
Fixed building by GCC 7 (broken in 0b10a73d4993).
2017-06-09 21:38:10 +03:00
Valentin Bartenev
cb1624fa42
Fixed building with epoll (broken in 92b4984ca3c1).
2017-06-09 21:37:29 +03:00
Igor Sysoev
d0c72e0726
C99 style declaration of connection states.
2017-06-06 18:57:58 +03:00
Igor Sysoev
49e9049ed2
Optimization of kqueue event processing on connection close.
2017-06-06 18:57:52 +03:00
Igor Sysoev
71c906a512
The controller did not work because of changes in the previous
...
changeset.
2017-06-06 18:53:15 +03:00
Igor Sysoev
5bc011afad
Skeleton of router configuration and request processing.
2017-05-31 15:26:45 +03:00
Valentin Bartenev
dee819daab
HTTP parser: changed style of a comment.
...
As requested by Igor.
2017-05-31 14:35:33 +03:00
Valentin Bartenev
c0bf729c8e
Controller: support for partial PUT and DELETE operations.
2017-05-30 17:12:20 +03:00
Igor Sysoev
f5c3b1c637
A small rbtree delete fixup optimization.
...
Setting node color to black is not required here because
it is already black. Besides in the original algorithm
the node pointer is discarded and the node is set to tree
root just to quit the loop.
Thanks to 洪志道 (Hong Zhi Dao).
2017-05-29 10:17:36 +03:00
Valentin Bartenev
5cca4b3ab7
Style and a trivial fix.
2017-05-26 20:30:51 +03:00
Igor Sysoev
4f9f463799
A small rbtree insert fixup optimization.
...
Thanks to 洪志道 (Hong Zhi Dao).
2017-05-26 19:12:47 +03:00
Valentin Bartenev
48155f3a49
Optimized internal representation of JSON objects and arrays.
2017-05-23 14:02:37 +03:00
Valentin Bartenev
c7be5bd6ae
Controller: partial retrieving of configuration.
2017-05-18 20:40:19 +03:00
Valentin Bartenev
dc95b2f3de
Controller: pretty-printing of JSON responses.
2017-05-16 22:02:01 +03:00
Valentin Bartenev
0ca2c2fce2
Controller: trivial abilities to save and request configuration.
...
Now you can get current configuration with:
$ curl 127.0.0.1:8443
and put new configuration with:
$ curl -X PUT -d @conf.json 127.0.0.1:8443
2017-05-15 22:39:53 +03:00