comparison src/c/urweb.c @ 2073:1839df6ed755

uw_remoteSock()
author Adam Chlipala <adam@chlipala.net>
date Sun, 16 Nov 2014 13:39:18 -0500
parents d77b0665ba7c
children fd6d362666c0 794017f378de
comparison
equal deleted inserted replaced
2072:d77b0665ba7c 2073:1839df6ed755
474 474
475 int usedSig, needsResig; 475 int usedSig, needsResig;
476 476
477 char *output_buffer; 477 char *output_buffer;
478 size_t output_buffer_size; 478 size_t output_buffer_size;
479
480 int remoteSock;
479 }; 481 };
480 482
481 size_t uw_headers_max = SIZE_MAX; 483 size_t uw_headers_max = SIZE_MAX;
482 size_t uw_page_max = SIZE_MAX; 484 size_t uw_page_max = SIZE_MAX;
483 size_t uw_heap_max = SIZE_MAX; 485 size_t uw_heap_max = SIZE_MAX;
556 ctx->usedSig = 0; 558 ctx->usedSig = 0;
557 ctx->needsResig = 0; 559 ctx->needsResig = 0;
558 560
559 ctx->output_buffer = malloc(1); 561 ctx->output_buffer = malloc(1);
560 ctx->output_buffer_size = 1; 562 ctx->output_buffer_size = 1;
563
564 ctx->remoteSock = -1;
561 565
562 return ctx; 566 return ctx;
563 } 567 }
564 568
565 size_t uw_inputs_max = SIZE_MAX; 569 size_t uw_inputs_max = SIZE_MAX;
644 ctx->queryString = NULL; 648 ctx->queryString = NULL;
645 ctx->nextId = 0; 649 ctx->nextId = 0;
646 ctx->amInitializing = 0; 650 ctx->amInitializing = 0;
647 ctx->usedSig = 0; 651 ctx->usedSig = 0;
648 ctx->needsResig = 0; 652 ctx->needsResig = 0;
653 ctx->remoteSock = -1;
649 } 654 }
650 655
651 void uw_reset_keep_request(uw_context ctx) { 656 void uw_reset_keep_request(uw_context ctx) {
652 uw_reset_keep_error_message(ctx); 657 uw_reset_keep_error_message(ctx);
653 ctx->error_message[0] = 0; 658 ctx->error_message[0] = 0;
4456 if (!isalnum(*p) && *p != '-' && *p != '_') 4461 if (!isalnum(*p) && *p != '-' && *p != '_')
4457 uw_error(ctx, FATAL, "Illegal HTML5 data-* attribute: %s", s); 4462 uw_error(ctx, FATAL, "Illegal HTML5 data-* attribute: %s", s);
4458 4463
4459 return s; 4464 return s;
4460 } 4465 }
4466
4467 int uw_remoteSock(uw_context ctx) {
4468 return ctx->remoteSock;
4469 }
4470
4471 void uw_set_remoteSock(uw_context ctx, int sock) {
4472 ctx->remoteSock = sock;
4473 }