Changeset 6de024fe1a245773c4b8c107f9063f2f40e5c344
- Timestamp:
- 01/05/11 02:42:51 (2 years ago)
- git-parent:
- Files:
-
- src/noit_http.c (modified) (2 diffs)
- src/noit_http.h (modified) (3 diffs)
- src/noit_rest.c (modified) (11 diffs)
- src/stratcon_jlog_streamer.c (modified) (3 diffs)
- src/stratcon_realtime_http.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noit_http.c
r1e1b047 r6de024f 47 47 #define HEADER_EXPECT "expect" 48 48 49 struct noit_http_connection { 50 eventer_t e; 51 int needs_close; 52 }; 53 54 struct noit_http_request { 55 struct bchain *first_input; /* The start of the input chain */ 56 struct bchain *last_input; /* The end of the input chain */ 57 struct bchain *current_input; /* The point of the input where we */ 58 size_t current_offset; /* analyzing. */ 59 60 enum { NOIT_HTTP_REQ_HEADERS = 0, 61 NOIT_HTTP_REQ_EXPECT, 62 NOIT_HTTP_REQ_PAYLOAD } state; 63 struct bchain *current_request_chain; 64 noit_boolean has_payload; 65 int64_t content_length; 66 int64_t content_length_read; 67 char *method_str; 68 char *uri_str; 69 char *protocol_str; 70 noit_hash_table querystring; 71 u_int32_t opts; 72 noit_http_method method; 73 noit_http_protocol protocol; 74 noit_hash_table headers; 75 noit_boolean complete; 76 struct timeval start_time; 77 char *orig_qs; 78 }; 79 80 struct noit_http_response { 81 noit_http_protocol protocol; 82 int status_code; 83 char *status_reason; 84 85 noit_hash_table headers; 86 struct bchain *leader; /* serialization of status line and headers */ 87 88 u_int32_t output_options; 89 struct bchain *output; /* data is pushed in here */ 90 struct bchain *output_raw; /* internally transcoded here for output */ 91 size_t output_raw_offset; /* tracks our offset */ 92 noit_boolean output_started; /* locks the options and leader */ 93 /* and possibly output. */ 94 noit_boolean closed; /* set by _end() */ 95 noit_boolean complete; /* complete, drained and disposable */ 96 size_t bytes_written; /* tracks total bytes written */ 97 }; 98 99 struct noit_http_session_ctx { 100 noit_atomic32_t ref_cnt; 101 int64_t drainage; 102 int max_write; 103 noit_http_connection conn; 104 noit_http_request req; 105 noit_http_response res; 106 noit_http_dispatch_func dispatcher; 107 void *dispatcher_closure; 108 acceptor_closure_t *ac; 109 }; 110 49 111 static noit_log_stream_t http_debug = NULL; 50 112 static noit_log_stream_t http_io = NULL; … … 125 187 n->size = size; 126 188 return n; 189 } 190 191 noit_http_request * 192 noit_http_session_request(noit_http_session_ctx *ctx) { 193 return &ctx->req; 194 } 195 noit_http_response * 196 noit_http_session_response(noit_http_session_ctx *ctx) { 197 return &ctx->res; 198 } 199 noit_http_connection * 200 noit_http_session_connection(noit_http_session_ctx *ctx) { 201 return &ctx->conn; 202 } 203 void 204 noit_http_session_set_dispatcher(noit_http_session_ctx *ctx, 205 int (*d)(noit_http_session_ctx *), void *dc) { 206 ctx->dispatcher = d; 207 ctx->dispatcher_closure = dc; 208 } 209 void *noit_http_session_dispatcher_closure(noit_http_session_ctx *ctx) { 210 return ctx->dispatcher_closure; 211 } 212 void noit_http_session_trigger(noit_http_session_ctx *ctx, int state) { 213 if(ctx->conn.e) eventer_trigger(ctx->conn.e, state); 214 } 215 uint32_t noit_http_session_ref_cnt(noit_http_session_ctx *ctx) { 216 return ctx->ref_cnt; 217 } 218 uint32_t noit_http_session_ref_dec(noit_http_session_ctx *ctx) { 219 return noit_atomic_dec32(&ctx->ref_cnt); 220 } 221 uint32_t noit_http_session_ref_inc(noit_http_session_ctx *ctx) { 222 return noit_atomic_inc32(&ctx->ref_cnt); 223 } 224 eventer_t noit_http_connection_event(noit_http_connection *conn) { 225 return conn->e; 226 } 227 const char *noit_http_request_uri_str(noit_http_request *req) { 228 return req->uri_str; 229 } 230 const char *noit_http_request_method_str(noit_http_request *req) { 231 return req->method_str; 232 } 233 const char *noit_http_request_protocol_str(noit_http_request *req) { 234 return req->protocol_str; 235 } 236 size_t noit_http_request_content_length(noit_http_request *req) { 237 return req->content_length; 238 } 239 const char *noit_http_request_querystring(noit_http_request *req, const char *k) { 240 void *vv; 241 const char *v = NULL; 242 if(noit_hash_retrieve(&req->querystring, k, strlen(k), &vv)) 243 v = vv; 244 return v; 245 } 246 noit_hash_table *noit_http_request_querystring_table(noit_http_request *req) { 247 return &req->querystring; 248 } 249 noit_hash_table *noit_http_request_headers_table(noit_http_request *req) { 250 return &req->headers; 251 } 252 noit_boolean noit_http_response_closed(noit_http_response *res) { 253 return res->closed; 127 254 } 128 255 src/noit_http.h
r68a5668 r6de024f 58 58 } bchain_type_t; 59 59 60 struct bchain; 61 62 #define DEFAULT_MAXWRITE 1<<14 /* 32k */ 63 #define DEFAULT_BCHAINSIZE ((1 << 15)-(offsetof(struct bchain, _buff))) 64 /* 64k - delta */ 65 #define DEFAULT_BCHAINMINREAD (DEFAULT_BCHAINSIZE/4) 66 #define BCHAIN_SPACE(a) ((a)->allocd - (a)->size - (a)->start) 67 68 struct noit_http_connection; 69 typedef struct noit_http_connection noit_http_connection; 70 struct noit_http_request; 71 typedef struct noit_http_request noit_http_request; 72 struct noit_http_response; 73 typedef struct noit_http_response noit_http_response; 74 60 75 struct bchain { 61 76 bchain_type_t type; … … 68 83 }; 69 84 70 #define DEFAULT_MAXWRITE 1<<14 /* 32k */71 #define DEFAULT_BCHAINSIZE ((1 << 15)-(offsetof(struct bchain, _buff)))72 /* 64k - delta */73 #define DEFAULT_BCHAINMINREAD (DEFAULT_BCHAINSIZE/4)74 #define BCHAIN_SPACE(a) ((a)->allocd - (a)->size - (a)->start)75 76 typedef struct {77 eventer_t e;78 int needs_close;79 } noit_http_connection;80 81 typedef struct {82 struct bchain *first_input; /* The start of the input chain */83 struct bchain *last_input; /* The end of the input chain */84 struct bchain *current_input; /* The point of the input where we */85 size_t current_offset; /* analyzing. */86 87 enum { NOIT_HTTP_REQ_HEADERS = 0,88 NOIT_HTTP_REQ_EXPECT,89 NOIT_HTTP_REQ_PAYLOAD } state;90 struct bchain *current_request_chain;91 noit_boolean has_payload;92 int64_t content_length;93 int64_t content_length_read;94 char *method_str;95 char *uri_str;96 char *protocol_str;97 noit_hash_table querystring;98 u_int32_t opts;99 noit_http_method method;100 noit_http_protocol protocol;101 noit_hash_table headers;102 noit_boolean complete;103 struct timeval start_time;104 char *orig_qs;105 } noit_http_request;106 107 typedef struct {108 noit_http_protocol protocol;109 int status_code;110 char *status_reason;111 112 noit_hash_table headers;113 struct bchain *leader; /* serialization of status line and headers */114 115 u_int32_t output_options;116 struct bchain *output; /* data is pushed in here */117 struct bchain *output_raw; /* internally transcoded here for output */118 size_t output_raw_offset; /* tracks our offset */119 noit_boolean output_started; /* locks the options and leader */120 /* and possibly output. */121 noit_boolean closed; /* set by _end() */122 noit_boolean complete; /* complete, drained and disposable */123 size_t bytes_written; /* tracks total bytes written */124 } noit_http_response;125 126 85 struct noit_http_session_ctx; 127 typedef int (*noit_http_dispatch_func) (struct noit_http_session_ctx *); 128 129 typedef struct noit_http_session_ctx { 130 noit_atomic32_t ref_cnt; 131 int64_t drainage; 132 int max_write; 133 noit_http_connection conn; 134 noit_http_request req; 135 noit_http_response res; 136 noit_http_dispatch_func dispatcher; 137 void *dispatcher_closure; 138 acceptor_closure_t *ac; 139 } noit_http_session_ctx; 86 typedef struct noit_http_session_ctx noit_http_session_ctx; 87 typedef int (*noit_http_dispatch_func) (noit_http_session_ctx *); 140 88 141 89 API_EXPORT(noit_http_session_ctx *) … … 144 92 API_EXPORT(void) 145 93 noit_http_ctx_session_release(noit_http_session_ctx *ctx); 94 API_EXPORT(uint32_t) 95 noit_http_session_ref_cnt(noit_http_session_ctx *); 96 API_EXPORT(uint32_t) 97 noit_http_session_ref_dec(noit_http_session_ctx *); 98 API_EXPORT(uint32_t) 99 noit_http_session_ref_inc(noit_http_session_ctx *); 100 API_EXPORT(void) 101 noit_http_session_trigger(noit_http_session_ctx *, int state); 146 102 103 API_EXPORT(noit_http_request *) 104 noit_http_session_request(noit_http_session_ctx *); 105 API_EXPORT(noit_http_response *) 106 noit_http_session_response(noit_http_session_ctx *); 107 API_EXPORT(noit_http_connection *) 108 noit_http_session_connection(noit_http_session_ctx *); 109 110 API_EXPORT(void *) 111 noit_http_session_dispatcher_closure(noit_http_session_ctx *); 112 API_EXPORT(void) 113 noit_http_session_set_dispatcher(noit_http_session_ctx *, 114 int (*)(noit_http_session_ctx *), void *); 115 116 API_EXPORT(eventer_t) 117 noit_http_connection_event(noit_http_connection *); 118 119 API_EXPORT(const char *) 120 noit_http_request_uri_str(noit_http_request *); 121 API_EXPORT(const char *) 122 noit_http_request_method_str(noit_http_request *); 123 API_EXPORT(const char *) 124 noit_http_request_protocol_str(noit_http_request *); 125 API_EXPORT(size_t) 126 noit_http_request_content_length(noit_http_request *); 127 API_EXPORT(const char *) 128 noit_http_request_querystring(noit_http_request *, const char *); 129 API_EXPORT(noit_hash_table *) 130 noit_http_request_querystring_table(noit_http_request *); 131 API_EXPORT(noit_hash_table *) 132 noit_http_request_headers_table(noit_http_request *); 133 134 API_EXPORT(noit_boolean) 135 noit_http_response_closed(noit_http_response *); 147 136 148 137 API_EXPORT(void) src/noit_rest.c
r90efcaa r6de024f 96 96 struct rule_container *cont = NULL; 97 97 struct rest_url_dispatcher *rule; 98 char *eoq, *eob; 99 eoq = strchr(restc->http_ctx->req.uri_str, '?'); 98 noit_http_request *req = noit_http_session_request(restc->http_ctx); 99 const char *uri_str; 100 const char *eoq, *eob; 101 uri_str = noit_http_request_uri_str(req); 102 eoq = strchr(uri_str, '?'); 100 103 if(!eoq) 101 eoq = restc->http_ctx->req.uri_str + strlen(restc->http_ctx->req.uri_str);104 eoq = uri_str + strlen(uri_str); 102 105 eob = eoq - 1; 103 106 … … 105 108 while(1) { 106 109 void *vcont; 107 while(eob >= restc->http_ctx->req.uri_str && *eob != '/') eob--;108 if(eob < restc->http_ctx->req.uri_str) break; /* off the front */109 if(noit_hash_retrieve(&dispatch_points, restc->http_ctx->req.uri_str,110 eob - restc->http_ctx->req.uri_str + 1, &vcont)) {110 while(eob >= uri_str && *eob != '/') eob--; 111 if(eob < uri_str) break; /* off the front */ 112 if(noit_hash_retrieve(&dispatch_points, uri_str, 113 eob - uri_str + 1, &vcont)) { 111 114 cont = vcont; 112 115 eob++; /* move past the determined base */ … … 119 122 int ovector[30]; 120 123 int cnt; 121 if(strcmp(rule->method, restc->http_ctx->req.method_str)) continue;124 if(strcmp(rule->method, noit_http_request_method_str(req))) continue; 122 125 if((cnt = pcre_exec(rule->expression, rule->extra, eob, eoq - eob, 0, 0, 123 126 ovector, sizeof(ovector)/sizeof(*ovector))) > 0) { … … 147 150 struct noit_rest_acl *acl; 148 151 struct noit_rest_acl_rule *rule; 152 noit_http_request *req = noit_http_session_request(restc->http_ctx); 153 const char *uri_str; 149 154 int ovector[30]; 150 155 156 uri_str = noit_http_request_uri_str(req); 151 157 for(acl = global_rest_acls; acl; acl = acl->next) { 152 158 if(acl->cn && pcre_exec(acl->cn, NULL, "", 0, 0, 0, 153 159 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 154 160 continue; 155 if(acl->url && pcre_exec(acl->url, NULL, restc->http_ctx->req.uri_str, 156 strlen(restc->http_ctx->req.uri_str), 0, 0, 161 if(acl->url && pcre_exec(acl->url, NULL, uri_str, strlen(uri_str), 0, 0, 157 162 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 158 163 continue; … … 161 166 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 162 167 continue; 163 if(rule->url && pcre_exec(rule->url, NULL, restc->http_ctx->req.uri_str, 164 strlen(restc->http_ctx->req.uri_str), 0, 0, 168 if(rule->url && pcre_exec(rule->url, NULL, uri_str, strlen(uri_str), 0, 0, 165 169 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 166 170 continue; … … 176 180 struct noit_rest_acl *acl; 177 181 struct noit_rest_acl_rule *rule; 182 noit_http_request *req = noit_http_session_request(restc->http_ctx); 183 const char *uri_str; 178 184 int ovector[30]; 179 185 186 uri_str = noit_http_request_uri_str(req); 180 187 if(!restc->remote_cn || !strlen(restc->remote_cn)) return noit_false; 181 188 for(acl = global_rest_acls; acl; acl = acl->next) { … … 184 191 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 185 192 continue; 186 if(acl->url && pcre_exec(acl->url, NULL, restc->http_ctx->req.uri_str, 187 strlen(restc->http_ctx->req.uri_str), 0, 0, 193 if(acl->url && pcre_exec(acl->url, NULL, uri_str, strlen(uri_str), 0, 0, 188 194 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 189 195 continue; … … 193 199 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 194 200 continue; 195 if(rule->url && pcre_exec(rule->url, NULL, restc->http_ctx->req.uri_str, 196 strlen(restc->http_ctx->req.uri_str), 0, 0, 201 if(rule->url && pcre_exec(rule->url, NULL, uri_str, strlen(uri_str), 0, 0, 197 202 ovector, sizeof(ovector)/sizeof(*ovector)) <= 0) 198 203 continue; … … 282 287 int 283 288 noit_rest_request_dispatcher(noit_http_session_ctx *ctx) { 284 noit_http_rest_closure_t *restc = ctx->dispatcher_closure;289 noit_http_rest_closure_t *restc = noit_http_session_dispatcher_closure(ctx); 285 290 rest_request_handler handler = restc->fastpath; 286 291 if(!handler) handler = noit_http_get_handler(restc); 287 292 if(handler) { 293 noit_http_response *res = noit_http_session_response(ctx); 288 294 int rv; 289 295 rv = handler(restc, restc->nparams, restc->params); 290 if( ctx->res.closed) noit_http_rest_clean_request(restc);296 if(noit_http_response_closed(res)) noit_http_rest_clean_request(restc); 291 297 return rv; 292 298 } … … 395 401 int *mask, int *complete) { 396 402 struct rest_xml_payload *rxc; 403 noit_http_request *req = noit_http_session_request(restc->http_ctx); 404 397 405 if(restc->call_closure == NULL) { 398 406 restc->call_closure = calloc(1, sizeof(*rxc)); … … 423 431 return NULL; 424 432 } 425 if(rxc->len == restc->http_ctx->req.content_length) {433 if(rxc->len == noit_http_request_content_length(req)) { 426 434 rxc->indoc = xmlParseMemory(rxc->buffer, rxc->len); 427 435 rxc->complete = 1; src/stratcon_jlog_streamer.c
rd9a21af r6de024f 1075 1075 noit_hash_iter iter = NOIT_HASH_ITER_ZERO; 1076 1076 char path[256]; 1077 void *key_id , *vstr;1077 void *key_id; 1078 1078 const char *type = NULL, *want_cn = NULL; 1079 1079 int klen, n = 0, i, di, cnt; … … 1083 1083 struct timeval now, diff, last; 1084 1084 xmlNodePtr node; 1085 1086 noit_http_process_querystring(&restc->http_ctx->req); 1087 if(noit_hash_retrieve(&restc->http_ctx->req.querystring, "type", 4, &vstr)) 1088 type = vstr; 1089 if(noit_hash_retrieve(&restc->http_ctx->req.querystring, "cn", 2, &vstr)) 1090 want_cn = vstr; 1085 noit_http_request *req = noit_http_session_request(restc->http_ctx); 1086 1087 noit_http_process_querystring(req); 1088 type = noit_http_request_querystring(req, "type"); 1089 want_cn = noit_http_request_querystring(req, "cn"); 1091 1090 1092 1091 gettimeofday(&now, NULL); … … 1353 1352 rest_set_noit(noit_http_rest_closure_t *restc, 1354 1353 int npats, char **pats) { 1355 void *vcn;1356 1354 const char *cn = NULL; 1357 1355 noit_http_session_ctx *ctx = restc->http_ctx; 1356 noit_http_request *req = noit_http_session_request(ctx); 1358 1357 unsigned short port = 43191; 1359 1358 if(npats < 1 || npats > 2) 1360 1359 noit_http_response_server_error(ctx, "text/xml"); 1361 1360 if(npats == 2) port = atoi(pats[1]); 1362 noit_http_process_querystring(&ctx->req); 1363 if(noit_hash_retrieve(&ctx->req.querystring, "cn", 2, &vcn)) 1364 cn = vcn; 1361 noit_http_process_querystring(req); 1362 cn = noit_http_request_querystring(req, "cn"); 1365 1363 if(stratcon_add_noit(pats[0], port, cn) >= 0) 1366 1364 noit_http_response_ok(ctx, "text/xml"); src/stratcon_realtime_http.c
r8c720f9 r6de024f 115 115 char *scp, *ecp, *token; 116 116 int len; 117 void *vcb;118 117 const char *v, *cb = NULL; 119 118 noit_hash_table json = NOIT_HASH_EMPTY; 119 noit_http_request *req = noit_http_session_request(ctx); 120 120 char s_inc_id[42]; 121 121 122 122 snprintf(s_inc_id, sizeof(s_inc_id), "script-%08x", inc_id); 123 if(noit_hash_retrieve(&ctx->req.querystring, "cb", strlen("cb"), &vcb))124 cb = vcb;123 124 cb = noit_http_request_querystring(req, "cb"); 125 125 for(v = cb; v && *v; v++) 126 126 if(!((*v >= '0' && *v <= '9') || … … 162 162 if(buff[1] == '\t' && (buff[0] == 'M' || buff[0] == 'S')) { 163 163 char target[256], module[256], name[256], uuid_str[UUID_STR_LEN+1]; 164 noit_http_request *req = noit_http_session_request(ctx); 165 noit_hash_table *qs; 164 166 noit_hash_iter iter = NOIT_HASH_ITER_ZERO; 165 167 const char *key; … … 174 176 ra_write(buffer, strlen(buffer)); 175 177 176 while(noit_hash_next(&ctx->req.querystring, &iter, &key, &klen, &vval)) { 178 qs = noit_http_request_querystring_table(req); 179 while(noit_hash_next(qs, &iter, &key, &klen, &vval)) { 177 180 if(!strcmp(key, "cb")) continue; 178 181 noit_hash_store(&json, key, klen, strdup(vval ?(char *)vval : "true")); … … 262 265 } 263 266 int 264 stratcon_realtime_uri_parse(realtime_context *rc, c har *uri) {267 stratcon_realtime_uri_parse(realtime_context *rc, const char *uri) { 265 268 int len, cnt = 0; 266 char *cp, *copy, *interest, *brk; 269 const char *cp, *interest; 270 char *copy, *brk; 267 271 if(strncmp(uri, "/data/", 6)) return 0; 268 272 cp = uri + 6; … … 300 304 realtime_recv_ctx_t *rrctx = vctx; 301 305 noit_http_session_ctx *ctx = rrctx->ctx; 302 realtime_context *rc = ctx->dispatcher_closure;303 304 if(noit_ atomic_dec32(&ctx->ref_cnt) == 1) {306 realtime_context *rc = noit_http_session_dispatcher_closure(ctx); 307 308 if(noit_http_session_ref_dec(ctx) == 1) { 305 309 noit_http_response_end(ctx); 306 310 clear_realtime_context(rc); 307 if(ctx->conn.e) eventer_trigger(ctx->conn.e, EVENTER_WRITE | EVENTER_EXCEPTION);311 noit_http_session_trigger(ctx, EVENTER_WRITE | EVENTER_EXCEPTION); 308 312 } 309 313 free(rrctx); … … 444 448 struct timeval *now) { 445 449 noit_http_session_ctx *ctx = closure; 446 realtime_context *rc = ctx->dispatcher_closure;450 realtime_context *rc = noit_http_session_dispatcher_closure(ctx); 447 451 struct realtime_tracker *node; 448 452 … … 459 463 } 460 464 else 461 noit_ atomic_dec32(&ctx->ref_cnt);462 } 463 if( ctx->ref_cnt== 1) {465 noit_http_session_ref_dec(ctx); 466 } 467 if(noit_http_session_ref_cnt(ctx) == 1) { 464 468 noit_http_response_end(ctx); 465 469 clear_realtime_context(rc); 466 if(ctx->conn.e) eventer_trigger(ctx->conn.e, EVENTER_WRITE);470 noit_http_session_trigger(ctx, EVENTER_WRITE); 467 471 } 468 472 return 0; … … 471 475 stratcon_request_dispatcher(noit_http_session_ctx *ctx) { 472 476 const char *key, *value; 473 realtime_context *rc = ctx->dispatcher_closure;477 realtime_context *rc = noit_http_session_dispatcher_closure(ctx); 474 478 int klen; 475 479 noit_hash_iter iter = NOIT_HASH_ITER_ZERO; 476 noit_http_request *req = &ctx->req;480 noit_http_request *req = noit_http_session_request(ctx); 477 481 478 482 if(rc->setup == RC_INITIAL) { … … 481 485 char c[1024]; 482 486 int num_interests; 483 484 num_interests = stratcon_realtime_uri_parse(rc, ctx->req.uri_str); 487 const char *uri_str = noit_http_request_uri_str(req); 488 noit_hash_table *headers = noit_http_request_headers_table(req); 489 490 num_interests = stratcon_realtime_uri_parse(rc, uri_str); 485 491 if(num_interests == 0) { 486 492 noit_http_response_status_set(ctx, 404, "OK"); … … 491 497 492 498 noitL(noit_error, "http: %s %s %s\n", 493 req->method_str, req->uri_str, req->protocol_str); 494 while(noit_hash_next_str(&req->headers, &iter, &key, &klen, &value)) { 499 noit_http_request_method_str(req), uri_str, 500 noit_http_request_protocol_str(req)); 501 while(noit_hash_next_str(headers, &iter, &key, &klen, &value)) { 495 502 noitL(noit_error, "http: [%s: %s]\n", key, value); 496 503 } … … 515 522 for(node = rc->checklist; node; node = node->next) { 516 523 char uuid_str[UUID_STR_LEN+1]; 517 noit_ atomic_inc32(&ctx->ref_cnt);524 noit_http_session_ref_inc(ctx); 518 525 uuid_unparse_lower(node->checkid, uuid_str); 519 526 noitL(noit_error, "Resolving uuid: %s\n", uuid_str); … … 545 552 const char *document_domain = NULL; 546 553 noit_http_session_ctx *ctx = restc->http_ctx; 554 noit_http_connection *conn = noit_http_session_connection(ctx); 555 eventer_t e; 547 556 acceptor_closure_t *ac = restc->ac; 548 557 … … 560 569 } 561 570 562 noit_http_process_querystring( &ctx->req);571 noit_http_process_querystring(noit_http_session_request(ctx)); 563 572 /* Rewire the http context */ 564 ctx->conn.e->callback = stratcon_realtime_http_handler; 565 ctx->dispatcher = stratcon_request_dispatcher; 566 ctx->dispatcher_closure = alloc_realtime_context(document_domain); 573 e = noit_http_connection_event(conn); 574 e->callback = stratcon_realtime_http_handler; 575 noit_http_session_set_dispatcher(ctx, stratcon_request_dispatcher, 576 alloc_realtime_context(document_domain)); 567 577 return stratcon_request_dispatcher(ctx); 568 578 }
