diff options
author | Ziv Scully <ziv@mit.edu> | 2014-11-24 20:47:38 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2014-11-24 20:47:38 -0500 |
commit | b59e6e96601c09bd97a4cce881c9b9f8bf8816a3 (patch) | |
tree | c2714306eb85c1e0d144089bbc3f6ed51e58cdda /src/c | |
parent | a413fc1a42bf0fbee27c2f22cc8e9ca9b17b9edf (diff) | |
parent | f3e50f123c33c26038b601475eeaa619526ad7ab (diff) |
Merge.
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/http.c | 2 | ||||
-rw-r--r-- | src/c/urweb.c | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/c/http.c b/src/c/http.c index 9651a216..e6c7b1af 100644 --- a/src/c/http.c +++ b/src/c/http.c @@ -89,6 +89,8 @@ static void *worker(void *data) { sock = uw_dequeue(); } + uw_set_remoteSock(ctx, sock); + qprintf("Handling connection with thread #%d.\n", me); while (1) { diff --git a/src/c/urweb.c b/src/c/urweb.c index 8ecef7c5..4cd347b2 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -479,6 +479,8 @@ struct uw_context { // For caching. char *recording; + + int remoteSock; }; size_t uw_headers_max = SIZE_MAX; @@ -564,6 +566,8 @@ uw_context uw_init(int id, uw_loggers *lg) { ctx->recording = 0; + ctx->remoteSock = -1; + return ctx; } @@ -651,6 +655,7 @@ void uw_reset_keep_error_message(uw_context ctx) { ctx->amInitializing = 0; ctx->usedSig = 0; ctx->needsResig = 0; + ctx->remoteSock = -1; } void uw_reset_keep_request(uw_context ctx) { @@ -4471,3 +4476,11 @@ uw_Basis_string uw_Basis_blessData(uw_context ctx, uw_Basis_string s) { return s; } + +int uw_remoteSock(uw_context ctx) { + return ctx->remoteSock; +} + +void uw_set_remoteSock(uw_context ctx, int sock) { + ctx->remoteSock = sock; +} |