* Threaded XMLRPC support. Sponsored by Xirvik.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1123 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-01-25 13:14:09 +00:00
parent 83ea813245
commit 588f9e80c7
12 changed files with 103 additions and 63 deletions
+13 -7
View File
@@ -49,6 +49,7 @@
#include "control.h"
#include "globals.h"
#include "scgi.h"
#include "parse_commands.h"
namespace rpc {
@@ -118,16 +119,16 @@ SCgi::open(void* sa, unsigned int length) {
void
SCgi::activate() {
main_thread->poll()->open(this);
main_thread->poll()->insert_read(this);
main_thread->poll()->insert_error(this);
worker_thread->poll()->open(this);
worker_thread->poll()->insert_read(this);
worker_thread->poll()->insert_error(this);
}
void
SCgi::deactivate() {
main_thread->poll()->remove_read(this);
main_thread->poll()->remove_error(this);
main_thread->poll()->close(this);
worker_thread->poll()->remove_read(this);
worker_thread->poll()->remove_error(this);
worker_thread->poll()->close(this);
}
void
@@ -163,7 +164,12 @@ SCgi::receive_call(SCgiTask* task, const char* buffer, uint32_t length) {
slot_write slotWrite;
slotWrite.set(rak::mem_fn(task, &SCgiTask::receive_write));
return m_slotProcess(buffer, length, slotWrite);
ThreadBase::acquire_global_lock();
// bool result = m_slotProcess(buffer, length, slotWrite);
bool result = xmlrpc.process(buffer, length, slotWrite);
ThreadBase::release_global_lock();
return result;
}
}