00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef USE_PCH
00017 #include "sys.h"
00018 #include "debug.h"
00019 #include <libcwd/buf2str.h>
00020 #endif
00021
00022 #include "Application.h"
00023 #include "ServerSession.h"
00024 #ifdef CWDEBUG
00025 #include "ServerConnection.h"
00026 #endif
00027
00028
00029 ServerSessionInput::ServerSessionInput(input_buffer_ct* ibuf) : read_input_tct<text>(ibuf), M_current_msg(static_cast<ServerSession*>(this))
00030 {
00031 }
00032
00033
00034
00035
00036
00037
00038 void ServerSessionInput::decode(msg_block_ct msg_block)
00039 {
00040 #ifdef CWDEBUG
00041
00042 bool is_ping = (msg_block.get_size() >= 5 && strncmp(msg_block.get_start(), "PING ", 5) == 0 && Application::instance().suppress_ping());
00043 Debug(if (is_ping) libcw_do.off());
00044
00045
00046 debug::SecondaryConnection dummy(dynamic_cast<ServerSession*>(this)->server_connection().secondary_connection());
00047 #endif
00048
00049 DoutEntering(dc::serverinput, "ServerSessionInput::decode(\"" << buf2str(msg_block.get_start(), msg_block.get_size()) << "\")");
00050
00051
00052 M_current_msg.init(msg_block);
00053
00054
00055 new_message_received(M_current_msg);
00056
00057
00058 Debug(if (is_ping) libcwd::libcw_do.on());
00059 }