[Reconnoiter-devel] [reconnoiter commit] Reconnoiter branch, master, updated. ee04721b5f474cd61c27829606db92c23a87eb87

git at labs.omniti.com git at labs.omniti.com
Fri Apr 13 16:13:37 EDT 2012


Pushed by: jesus
The branch, master has been updated
       via  ee04721b5f474cd61c27829606db92c23a87eb87 (commit)
      from  93ee67631e38d219f26ed5c4cfadb77fe919a653 (commit)

Summary of changes:
 src/noit_http.c |   19 ++++++++++++++++---
 src/noit_http.h |    2 ++
 2 files changed, 18 insertions(+), 3 deletions(-)

Log:
commit ee04721b5f474cd61c27829606db92c23a87eb87
Author: Theo Schlossnagle <jesus at omniti.com>
Date:   Fri Apr 13 20:12:49 2012 +0000

    Allow asynchronous threads to call flush on http connections, which
    does all the same work, but doesn't attempt to manipulate the state
    of the connection in the eventer.

diff --git a/src/noit_http.c b/src/noit_http.c
index 23deee8..a0976e5 100644
--- a/src/noit_http.c
+++ b/src/noit_http.c
@@ -1309,8 +1309,10 @@ raw_finalize_encoding(noit_http_response *res) {
     res->gzip = NULL;
   }
 }
-noit_boolean
-noit_http_response_flush(noit_http_session_ctx *ctx, noit_boolean final) {
+static noit_boolean
+_noit_http_response_flush(noit_http_session_ctx *ctx,
+                          noit_boolean final,
+                          noit_boolean update_eventer) {
   struct bchain *o, *r;
   int mask, rv;
 
@@ -1370,7 +1372,7 @@ noit_http_response_flush(noit_http_session_ctx *ctx, noit_boolean final) {
   }
 
   rv = _http_perform_write(ctx, &mask);
-  if(ctx->conn.e) {
+  if(update_eventer && ctx->conn.e) {
     eventer_update(ctx->conn.e, mask);
   }
   if(rv < 0) return noit_false;
@@ -1381,6 +1383,17 @@ noit_http_response_flush(noit_http_session_ctx *ctx, noit_boolean final) {
 }
 
 noit_boolean
+noit_http_response_flush(noit_http_session_ctx *ctx,
+                         noit_boolean final) {
+  _noit_http_response_flush(ctx, final, noit_true);
+}
+noit_boolean
+noit_http_response_flush_asynch(noit_http_session_ctx *ctx,
+                                noit_boolean final) {
+  _noit_http_response_flush(ctx, final, noit_false);
+}
+
+noit_boolean
 noit_http_response_end(noit_http_session_ctx *ctx) {
   if(!noit_http_response_flush(ctx, noit_true)) return noit_false;
   return noit_true;
diff --git a/src/noit_http.h b/src/noit_http.h
index d1a022b..c1eaf79 100644
--- a/src/noit_http.h
+++ b/src/noit_http.h
@@ -166,6 +166,8 @@ API_EXPORT(noit_boolean)
                                  int fd, size_t len, int flags, off_t offset);
 API_EXPORT(noit_boolean)
   noit_http_response_flush(noit_http_session_ctx *, noit_boolean);
+API_EXPORT(noit_boolean)
+  noit_http_response_flush_asynch(noit_http_session_ctx *, noit_boolean);
 API_EXPORT(noit_boolean) noit_http_response_end(noit_http_session_ctx *);
 
 #define noit_http_response_server_error(ctx, type) \




hooks/post-receive
-- 
Reconnoiter


More information about the Reconnoiter-devel mailing list