Changeset a29e7fc578381672499281e5e8a970082194417f

Show
Ignore:
Timestamp:
07/14/11 16:24:47 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1310660687 -0400
git-parent:

[209711be5bf2a026e9d8d04fef2e05aaeb77c884]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1310660687 -0400
Message:

support logging of new connections on our own log stream {error,debug}/listener

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_listener.c

    rc6a5f68 ra29e7fc  
    4747#include "noit_conf.h" 
    4848 
     49static noit_log_stream_t nlerr = NULL; 
     50static noit_log_stream_t nldeb = NULL; 
    4951static noit_hash_table listener_commands = NOIT_HASH_EMPTY; 
    5052noit_hash_table * 
     
    9092    } 
    9193    e->closure = ac; 
     94    noitL(nlerr, "noit_listener[%s] SSL_accept on fd %d [%s]\n", 
     95          eventer_name_for_callback(e->callback), 
     96          e->fd, ac->remote_cn ? ac->remote_cn : "anonymous"); 
    9297    return e->callback(e, mask, e->closure, tv); 
    9398  } 
     
    124129    if(conn >= 0) { 
    125130      eventer_t newe; 
     131      noitL(nlerr, "noit_listener[%s] accepted fd %d\n", 
     132            eventer_name_for_callback(listener_closure->dispatch_callback), 
     133            conn); 
    126134      if(eventer_set_fd_nonblocking(conn)) { 
    127135        close(conn); 
     
    217225  const char *event_name; 
    218226 
    219   noitL(noit_debug, "noit_listener(%s, %d, %d, %d, %s, %p)\n", 
     227  noitL(nldeb, "noit_listener(%s, %d, %d, %d, %s, %p)\n", 
    220228        host, port, type, backlog, 
    221229        (event_name = eventer_name_for_callback(handler))?event_name:"??", 
     
    521529void 
    522530noit_listener_init(const char *toplevel) { 
     531  nlerr = noit_log_stream_find("error/listener"); 
     532  nldeb = noit_log_stream_find("debug/listener"); 
     533  if(!nlerr) nlerr = noit_error; 
     534  if(!nldeb) nldeb = noit_debug; 
    523535  eventer_name_callback("noit_listener_acceptor", noit_listener_acceptor); 
    524536  eventer_name_callback("noit_listener_accept_ssl", noit_listener_accept_ssl);