Commit Graph

861 Commits

Author SHA1 Message Date
Igor Sysoev
46c6513c2b Fixed port processing in nxt_sockaddr_text(). 2017-06-29 19:25:46 +03:00
Igor Sysoev
499a8f9ac8 Using static and constant linger structure. 2017-06-29 15:52:47 +03:00
Igor Sysoev
52f79c3e53 Fixed building on Solaris broken in changeset 4077decf847b. 2017-06-28 23:52:07 +03:00
Valentin Bartenev
e4afc6ae98 Controller: fixed reading of request body. 2017-06-28 22:48:13 +03:00
Valentin Bartenev
53074c3b29 Configuration: reduced names of structures, functions, and macros. 2017-06-28 18:56:33 +03:00
Igor Sysoev
ec5e540fd7 Fixed building with enabled IPv6 support. 2017-06-28 18:01:00 +03:00
Igor Sysoev
ee381fcca1 JSON property iterator nxt_conf_json_object_next_member(). 2017-06-28 15:26:54 +03:00
Igor Sysoev
d8f371dde9 Setting listen socket fields lost in changeset 10688b89aa16. 2017-06-28 15:16:28 +03:00
Igor Sysoev
61c20aae4b Small optimization in nxt_sockaddr_text(). 2017-06-28 09:33:35 +03:00
Igor Sysoev
2006e9f537 Fixed INET6 sockaddr processing in nxt_sockaddr_text(). 2017-06-27 20:06:59 +03:00
Igor Sysoev
cf3e714c39 Fixed Unix sockaddr processing in nxt_sockaddr_text(). 2017-06-27 20:06:56 +03:00
Igor Sysoev
9041d276fc nxt_sockaddr_parse() introducted. 2017-06-27 19:06:58 +03:00
Valentin Bartenev
dfd3cc8c0e Applied nxt_pointer_to() and nxt_value_at() where possible. 2017-06-27 17:27:18 +03:00
Valentin Bartenev
f86c803098 Interface for mapping JSON configuration objects to C structures. 2017-06-26 21:41:58 +03:00
Valentin Bartenev
01517e37c1 Simplified nxt_conf_json_object_get_member(). 2017-06-26 20:22:57 +03:00
Max Romanov
44b3ad17f4 Double buf completion call on connection timeout fixed. 2017-06-26 19:58:43 +03:00
Max Romanov
d62e6c3b18 PHP post body processing fixed, default index name introduced. 2017-06-26 19:58:43 +03:00
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