26 pool.activate (THR_NEW_LWP | THR_JOINABLE,
POOL_SIZE);
30 soap_set_imode(&soap, SOAP_C_UTFSTRING);
31 soap_set_omode(&soap, SOAP_C_UTFSTRING);
34 soap.accept_timeout = 3;
35 soap.recv_timeout = 5;
36 soap.send_timeout = 5;
40 pool.msg_queue()->deactivate();
50 if (!soap_valid_socket(soap_accept(&soap)))
53 sLog.outDebug(
"OCSoap: accepted connection from IP=%d.%d.%d.%d", (
int)(soap.ip >> 24) & 0xFF, (
int)(soap.ip >> 16) & 0xFF, (
int)(soap.ip >> 8) & 0xFF, (
int)soap.ip & 0xFF);
54 struct soap* thread_soap = soap_copy(&soap);
56 ACE_Message_Block* mb =
new ACE_Message_Block(
sizeof(
struct soap*));
57 ACE_OS::memcpy (mb->wr_ptr(), &thread_soap,
sizeof(
struct soap*));
61 pool.msg_queue()->deactivate();
69 ACE_TRACE (ACE_TEXT (
"SOAPWorkingThread::process_message"));
72 ACE_OS::memcpy (&soap, mb->rd_ptr (),
sizeof(
struct soap*));
89 if (!soap->userid || !soap->passwd)
91 sLog.outDebug(
"OCSoap: Client didn't provide login information");
98 sLog.outDebug(
"OCSoap: Client used invalid username '%s'", soap->userid);
102 if (!
sAccountMgr->CheckPassword(accountId, soap->passwd))
104 sLog.outDebug(
"OCSoap: invalid password for account '%s'", soap->userid);
110 sLog.outDebug(
"OCSoap: %s's gmlevel is too low", soap->userid);
114 if (!command || !*command)
115 return soap_sender_fault(soap,
"Command must not be empty",
"The supplied command was an empty string");
117 sLog.outDebug(
"OCSoap: got command '%s'", command);
124 sWorld.QueueCliCommand(cmd);
131 sLog.outError(
"OCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
135 char* printBuffer = soap_strdup(soap, connection.
m_printBuffer.c_str());
138 *result = printBuffer;
142 return soap_sender_fault(soap, printBuffer, printBuffer);
161 {
"SOAP-ENV",
"http://schemas.xmlsoap.org/soap/envelope/", NULL, NULL },
162 {
"SOAP-ENC",
"http://schemas.xmlsoap.org/soap/encoding/", NULL, NULL },
163 {
"xsi",
"http://www.w3.org/1999/XMLSchema-instance",
"http://www.w3.org/*/XMLSchema-instance", NULL },
164 {
"xsd",
"http://www.w3.org/1999/XMLSchema",
"http://www.w3.org/*/XMLSchema", NULL, },
165 {
"ns1",
"urn:Oregon", NULL, NULL },
166 { NULL, NULL, NULL, NULL }
ACE_Semaphore pendingCommands
int ns1__executeCommand(soap *soap, char *command, char **result)
void process_message(ACE_Message_Block *mb)
struct Namespace namespaces[]
#define sLog
Log class singleton.
static void print(void *callbackArg, const char *msg)
void setCommandSuccess(bool val)
static void commandFinished(void *callbackArg, bool success)
bool hasCommandSucceeded()
std::string m_printBuffer