+
+bool Conn::WriteResponse()
+{
+ STG::ENCRYPT_STREAM stream(m_admin->GetPassword(), WriteCallback, this);
+ const std::string & answer = m_parser->GetAnswer();
+ stream.Put(answer.c_str(), answer.length() + 1 /* including \0 */, true /* final */);
+ return stream.IsOk();
+}
+
+bool Conn::WriteCallback(const void * block, size_t size, void * data)
+{
+ assert(data != NULL);
+ Conn & conn = *static_cast<Conn *>(data);
+ return WriteAll(conn.m_sock, block, size);;
+}