Changeset ac70325cbd950a7a919b9f19306f0a84070a0894

Show
Ignore:
Timestamp:
12/23/11 01:56:35 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1324605395 +0000
git-parent:

[3bbaa0da7225113c572ed112338d2cb93569d097], [d95758d937b018c25bc4487c8eddc4727ee7d390]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1324605395 +0000
Message:

Merge branch 'master' of labs.omniti.com:reconnoiter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/handoff_ingestor.c

    r9d3260a rd95758d  
    6060static noit_log_stream_t ds_deb = NULL; 
    6161static noit_log_stream_t ingest_err = NULL; 
     62static pthread_mutex_t http_ctx_lock = PTHREAD_MUTEX_INITIALIZER; 
    6263 
    6364static int storage_node_quick_lookup(const char *uuid_str, 
     
    191192 
    192193  noitL(noit_debug, " handoff -> %s\n", hfile); 
     194  pthread_mutex_lock(&http_ctx_lock); 
    193195  if(the_one_and_only) { 
    194196    noit_http_session_ctx *ctx = the_one_and_only; 
     
    200202    } 
    201203  } 
     204  pthread_mutex_unlock(&http_ctx_lock); 
    202205  return 0; 
    203206} 
     
    213216    return 0; 
    214217  } 
     218  pthread_mutex_lock(&http_ctx_lock); 
    215219  the_one_and_only = ctx; 
    216220  noit_http_response_status_set(ctx, 200, "OK"); 
     
    219223  noit_http_response_append(ctx, hello, strlen(hello)); 
    220224  noit_http_response_flush(ctx, noit_false); 
     225  pthread_mutex_unlock(&http_ctx_lock); 
    221226  return EVENTER_EXCEPTION; 
    222227} 
     
    230235  rv = noit_http_session_drive(e, mask, http_ctx, now, &done); 
    231236  if(done) { 
     237    pthread_mutex_lock(&http_ctx_lock); 
    232238    the_one_and_only = NULL; 
     239    pthread_mutex_unlock(&http_ctx_lock); 
    233240    acceptor_closure_free(ac); 
    234241  }