From d34015c5ba231b95de20e9fcd7a33c5b2b9a1006 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:45 +0200 Subject: tagging ychat-0.5.3 --- src/sock.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sock.cpp') diff --git a/src/sock.cpp b/src/sock.cpp index 490278f..4645db8 100755 --- a/src/sock.cpp +++ b/src/sock.cpp @@ -24,6 +24,8 @@ sock::sock() this->i_req = 0; this->req_parser = new reqp(); this->thrd_pool = new pool(); + this->log_daemon = new logd(s_conf::get + ().get_val( "ACCESS_LOG" )); } void @@ -82,7 +84,7 @@ sock::make_socket( uint16_t i_port ) { cerr << "Sock: socket error" << endl; - if ( ((int)++i_port) > MAXPORT ) + if ( ++i_port > MAXPORT ) exit(-1); cerr << SOCKERR << i_port << endl; @@ -142,6 +144,9 @@ sock::read_write( thrd* p_thrd, int i_sock ) string s_rep = req_parser->parse( p_thrd, string( c_req ), map_params ); + // send s_rep to the client. + log_daemon->log(map_params); + send( i_sock, s_rep.c_str(), s_rep.size(), 0 ); // dont need those vals anymore. -- cgit v1.2.3