diff 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
line wrap: on
line diff
--- a/src/c/urweb.c	Sat Sep 20 13:55:25 2014 -0400
+++ b/src/c/urweb.c	Sun Nov 16 13:39:18 2014 -0500
@@ -476,6 +476,8 @@
 
   char *output_buffer;
   size_t output_buffer_size;
+
+  int remoteSock;
 };
 
 size_t uw_headers_max = SIZE_MAX;
@@ -559,6 +561,8 @@
   ctx->output_buffer = malloc(1);
   ctx->output_buffer_size = 1;
 
+  ctx->remoteSock = -1;
+
   return ctx;
 }
 
@@ -646,6 +650,7 @@
   ctx->amInitializing = 0;
   ctx->usedSig = 0;
   ctx->needsResig = 0;
+  ctx->remoteSock = -1;
 }
 
 void uw_reset_keep_request(uw_context ctx) {
@@ -4458,3 +4463,11 @@
 
   return s;
 }
+
+int uw_remoteSock(uw_context ctx) {
+  return ctx->remoteSock;
+}
+
+void uw_set_remoteSock(uw_context ctx, int sock) {
+  ctx->remoteSock = sock;
+}