Merge remote-tracking branch 'origin/master' into research-unhelp

This commit is contained in:
Curtis Yarvin 2018-05-09 11:01:44 -07:00
commit 847c627003
6 changed files with 26 additions and 11 deletions

View File

@ -56,7 +56,7 @@ are included as git submodules. To build urbit from source, perform the followin
To configure project, enter the build directory and enter
`meson configure`. Without any arguments this command will display available
options. For example, to compile debug build of urbit, use
`meson configure -Ddebug=true`.
`meson configure -Dbuildtype=debug`.
To set the prefix for installation use
`meson configure -Dprefix=/usr`, and so on.

View File

@ -36,11 +36,20 @@
c3_y hun_y[0];
} u3_hbod;
/* u3_rsat: http request state.
*/
typedef enum {
u3_rsat_init = 0, // initialized
u3_rsat_plan = 1, // planned
u3_rsat_ripe = 2 // responded
} u3_rsat;
/* u3_hreq: incoming http request.
*/
typedef struct _u3_hreq {
h2o_req_t* rec_u; // h2o request
c3_w seq_l; // sequence within connection
u3_rsat sat_e; // request state
struct _u3_hcon* hon_u; // connection backlink
struct _u3_hreq* nex_u; // next in connection's list
} u3_hreq;

View File

@ -349,17 +349,10 @@ softfloat3_dep = dependency('softfloat3', version: '>=3.0.0', fallback: ['softfl
libuv_dep = dependency('libuv', version: '>=1.8.0', fallback:['libuv', 'libuv_dep'])
libh2o_dep = dependency('libh2o', version: '>=0.13.3', fallback: ['libh2o', 'libh2o_dep'])
opt_flags = []
if get_option('debug')
opt_flags = ['-g']
else
opt_flags = ['-O3']
endif
executable('urbit',
sources : sources,
include_directories : incdir,
c_args : opt_flags + os_c_flags,
c_args : os_c_flags,
link_args: os_link_flags,
dependencies: [openssl_dep,
curl_dep,

View File

@ -1 +0,0 @@
option('debug', type:'boolean', value: false)

View File

@ -1,5 +1,5 @@
#!/bin/bash
mkdir ./build &> /dev/null
meson . ./build
meson . ./build -Dbuildtype=release
ninja -C build

View File

@ -232,6 +232,7 @@ _http_req_new(u3_hcon* hon_u, h2o_req_t* rec_u)
{
u3_hreq* req_u = c3_malloc(sizeof(*req_u));
req_u->rec_u = rec_u;
req_u->sat_e = u3_rsat_init;
_http_req_link(hon_u, req_u);
return req_u;
@ -263,6 +264,9 @@ _http_req_kill(u3_hreq* req_u)
static void
_http_req_dispatch(u3_hreq* req_u, u3_noun req)
{
c3_assert(u3_rsat_init == req_u->sat_e);
req_u->sat_e = u3_rsat_plan;
u3_noun pox = _http_req_to_duct(req_u);
u3_noun typ = _(req_u->hon_u->htp_u->lop) ? c3__chis : c3__this;
@ -295,6 +299,16 @@ _http_hgen_dispose(void* ptr_v)
static void
_http_req_respond(u3_hreq* req_u, u3_noun sas, u3_noun hed, u3_noun bod)
{
// XX ideally
//c3_assert(u3_rsat_plan == req_u->sat_e);
if ( u3_rsat_plan != req_u->sat_e ) {
//uL(fprintf(uH, "duplicate response\n"));
return;
}
req_u->sat_e = u3_rsat_ripe;
h2o_req_t* rec_u = req_u->rec_u;
rec_u->res.status = sas;