comparison src/c/urweb.c @ 1370:44a12a321150

queryString and effectfulUrl
author Adam Chlipala <adam@chlipala.net>
date Sun, 26 Dec 2010 17:29:03 -0500
parents 1a78ca089bd0
children 268d9af9103f
comparison
equal deleted inserted replaced
1369:1a78ca089bd0 1370:44a12a321150
441 void *logger_data; 441 void *logger_data;
442 uw_logger log_debug; 442 uw_logger log_debug;
443 443
444 int hasPostBody; 444 int hasPostBody;
445 uw_Basis_postBody postBody; 445 uw_Basis_postBody postBody;
446 uw_Basis_string queryString;
446 447
447 char error_message[ERROR_BUF_LEN]; 448 char error_message[ERROR_BUF_LEN];
448 }; 449 };
449 450
450 size_t uw_headers_max = SIZE_MAX; 451 size_t uw_headers_max = SIZE_MAX;
505 506
506 ctx->logger_data = logger_data; 507 ctx->logger_data = logger_data;
507 ctx->log_debug = log_debug; 508 ctx->log_debug = log_debug;
508 509
509 ctx->hasPostBody = 0; 510 ctx->hasPostBody = 0;
511
512 ctx->queryString = NULL;
510 513
511 return ctx; 514 return ctx;
512 } 515 }
513 516
514 size_t uw_inputs_max = SIZE_MAX; 517 size_t uw_inputs_max = SIZE_MAX;
583 ctx->client = NULL; 586 ctx->client = NULL;
584 ctx->cur_container = NULL; 587 ctx->cur_container = NULL;
585 ctx->used_transactionals = 0; 588 ctx->used_transactionals = 0;
586 ctx->script_header = ""; 589 ctx->script_header = "";
587 ctx->hasPostBody = 0; 590 ctx->hasPostBody = 0;
591 ctx->queryString = NULL;
588 } 592 }
589 593
590 void uw_reset_keep_request(uw_context ctx) { 594 void uw_reset_keep_request(uw_context ctx) {
591 uw_reset_keep_error_message(ctx); 595 uw_reset_keep_error_message(ctx);
592 ctx->error_message[0] = 0; 596 ctx->error_message[0] = 0;
3600 3604
3601 int uw_hasPostBody(uw_context ctx) { 3605 int uw_hasPostBody(uw_context ctx) {
3602 return ctx->hasPostBody; 3606 return ctx->hasPostBody;
3603 } 3607 }
3604 3608
3609 void uw_setQueryString(uw_context ctx, uw_Basis_string s) {
3610 ctx->queryString = s;
3611 }
3612
3613 uw_Basis_string uw_queryString(uw_context ctx) {
3614 return ctx->queryString;
3615 }
3616
3605 uw_Basis_postBody uw_getPostBody(uw_context ctx) { 3617 uw_Basis_postBody uw_getPostBody(uw_context ctx) {
3606 if (ctx->hasPostBody) 3618 if (ctx->hasPostBody)
3607 return ctx->postBody; 3619 return ctx->postBody;
3608 else 3620 else
3609 uw_error(ctx, FATAL, "Asked for POST body when none exists"); 3621 uw_error(ctx, FATAL, "Asked for POST body when none exists");