summaryrefslogtreecommitdiff
path: root/src/sock.cpp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
commitd34015c5ba231b95de20e9fcd7a33c5b2b9a1006 (patch)
treeceac33bd27e3b1158a0ac4e17f7fd7e5e6473fea /src/sock.cpp
parentc507ce3198ea4d822832cc8740f0128df8873c02 (diff)
tagging ychat-0.5.3ychat-0.5.3
Diffstat (limited to 'src/sock.cpp')
-rwxr-xr-xsrc/sock.cpp7
1 files changed, 6 insertions, 1 deletions
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.