diff options
Diffstat (limited to 'community/fatrat/pion-5.0.diff')
-rw-r--r-- | community/fatrat/pion-5.0.diff | 1570 |
1 files changed, 0 insertions, 1570 deletions
diff --git a/community/fatrat/pion-5.0.diff b/community/fatrat/pion-5.0.diff deleted file mode 100644 index ff84fb902..000000000 --- a/community/fatrat/pion-5.0.diff +++ /dev/null @@ -1,1570 +0,0 @@ -diff -rup fatrat-1.2.0_beta2/CMakeLists.txt fatrat-1.2.0_beta2.new/CMakeLists.txt ---- fatrat-1.2.0_beta2/CMakeLists.txt 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/CMakeLists.txt 2013-04-29 19:17:48.697623940 +0100 -@@ -148,19 +148,13 @@ if(WITH_DOCUMENTATION) - set(QT_USE_QTHELP TRUE) - endif(WITH_DOCUMENTATION) - if(WITH_WEBINTERFACE) -- pkg_check_modules(pion-net REQUIRED "pion-net >= 3.0.0") -+ pkg_check_modules(pion REQUIRED "pion >= 5.0.0") - -- if(pion-net_FOUND) -- include_directories(${pion-net_INCLUDE_DIRS}) -- #message(STATUS "Pion libdir: ${pion-net_LIBDIR}") -- -- #FILE(GLOB pion_FileService "${pion-net_LIBDIR}/pion/plugins/FileService.*") -- #if(pion_FileService MATCHES "^$") -- # message(FATAL_ERROR "Pion-net FileService plugin not found (libpion-net-plugins?) - ${pion_FileService}") -- #endif(pion_FileService MATCHES "^$") -- else(pion-net_FOUND) -- message(FATAL_ERROR "No pion-net library found") -- endif(pion-net_FOUND) -+ if(pion_FOUND) -+ include_directories(${pion_INCLUDE_DIRS}) -+ else(pion_FOUND) -+ message(FATAL_ERROR "No pion library found") -+ endif(pion_FOUND) - endif(WITH_WEBINTERFACE) - - #set(CMAKE_REQUIRED_INCLUDES "sys/types.h") -@@ -570,9 +564,7 @@ ${fatrat_QRC_H} ${lrelease_outputs}) - add_executable(fatrat-conf src/fatrat-conf.cpp) - - # This used to be a workaround until it started causing the exact opposite... oh dear! --#STRING(REPLACE "-mt" "" pion-net_LIBRARIES "${pion-net_LIBRARIES}") --#message(STATUS ${pion-net_LIBRARIES}) --target_link_libraries(fatrat -ldl -lpthread ${QT_LIBRARIES} ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} ${pion-net_LIBRARIES} ${QT_ADDITIONAL_LIBS} ${XATTR_LIBRARIES} -export-dynamic) -+target_link_libraries(fatrat -ldl -lpthread ${QT_LIBRARIES} ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} ${pion_LIBRARIES} ${QT_ADDITIONAL_LIBS} ${XATTR_LIBRARIES} -export-dynamic) - target_link_libraries(fatrat-conf ${QT_LIBRARIES}) - - set(fatrat_DEV_HEADERS -Only in fatrat-1.2.0_beta2.new/: CMakeLists.txt.orig -diff -rup fatrat-1.2.0_beta2/config.h.in fatrat-1.2.0_beta2.new/config.h.in ---- fatrat-1.2.0_beta2/config.h.in 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/config.h.in 2013-04-29 19:18:03.241412755 +0100 -@@ -13,7 +13,7 @@ - #cmakedefine WITH_CXX0X - - #ifdef WITH_WEBINTERFACE --# define PION_NET_PLUGINS "${pion-net_LIBDIR}/pion/plugins" -+# define PION_NET_PLUGINS "${pion_LIBDIR}/pion/plugins" - #endif - - #cmakedefine ENABLE_FAKEDOWNLOAD -diff -rup fatrat-1.2.0_beta2/src/remote/HttpService.cpp fatrat-1.2.0_beta2.new/src/remote/HttpService.cpp ---- fatrat-1.2.0_beta2/src/remote/HttpService.cpp 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/HttpService.cpp 2013-04-29 19:17:17.076634049 +0100 -@@ -51,9 +51,8 @@ respects for all of the code used other - #include <QMultiMap> - #include <QProcess> - #include <QFile> --#include <pion/net/PionUser.hpp> --#include <pion/net/HTTPBasicAuth.hpp> --#include <pion/net/HTTPResponseWriter.hpp> -+#include <pion/http/basic_auth.hpp> -+#include <pion/http/response_writer.hpp> - #include <boost/filesystem/fstream.hpp> - #include "pion/FileService.hpp" - #include <cstdlib> -@@ -63,7 +62,7 @@ respects for all of the code used other - #include <string.h> - #include <algorithm> - --using namespace pion::net; -+using namespace pion::http; - - extern QList<Queue*> g_queues; - extern QReadWriteLock g_queuesLock; -@@ -172,16 +171,16 @@ void HttpService::applySettings() - - void HttpService::setupAuth() - { -- pion::net::PionUserManagerPtr userManager(new pion::net::PionUserManager); -+ pion::user_manager_ptr userManager(new pion::user_manager); - QString password = getSettingsValue("remote/password").toString(); - -- m_auth_ptr = pion::net::HTTPAuthPtr( new pion::net::HTTPBasicAuth(userManager, "FatRat Web Interface") ); -- m_server->setAuthentication(m_auth_ptr); -- m_auth_ptr->addRestrict("/"); -- -- m_auth_ptr->addUser("fatrat", password.toStdString()); -- m_auth_ptr->addUser("admin", password.toStdString()); -- m_auth_ptr->addUser("user", password.toStdString()); -+ m_auth_ptr = pion::http::auth_ptr( new pion::http::basic_auth(userManager, "FatRat Web Interface") ); -+ m_server->set_authentication(m_auth_ptr); -+ m_auth_ptr->add_restrict("/"); -+ -+ m_auth_ptr->add_user("fatrat", password.toStdString()); -+ m_auth_ptr->add_user("admin", password.toStdString()); -+ m_auth_ptr->add_user("user", password.toStdString()); - } - - void HttpService::setup() -@@ -190,28 +189,30 @@ void HttpService::setup() - - try - { -- m_server = new pion::net::WebServer(m_port); -+ m_server = new pion::http::plugin_server(m_port); - - setupAuth(); - setupSSL(); - -- m_server->addService("/xmlrpc", new XmlRpcService); -- m_server->addService("/subclass", new SubclassService); -- m_server->addService("/log", new LogService); -- m_server->addService("/browse", new TransferTreeBrowserService); -- m_server->addService("/", new pion::plugins::FileService); -- m_server->setServiceOption("/", "directory", DATA_LOCATION "/data/remote"); -- m_server->setServiceOption("/", "file", DATA_LOCATION "/data/remote/index.html"); -- m_server->addService("/copyrights", new pion::plugins::FileService); -- m_server->setServiceOption("/copyrights", "file", DATA_LOCATION "/README"); -- m_server->addService("/download", new TransferDownloadService); -- m_server->addService("/captcha", new CaptchaService); -+ m_server->add_service("/xmlrpc", new XmlRpcService); -+ m_server->add_service("/subclass", new SubclassService); -+ m_server->add_service("/log", new LogService); -+ m_server->add_service("/browse", new TransferTreeBrowserService); -+ m_server->add_service("/", new pion::plugins::FileService); -+ m_server->set_service_option("/", "directory", DATA_LOCATION "/data/remote"); -+ m_server->set_service_option("/", "file", DATA_LOCATION "/data/remote/index.html"); -+ m_server->add_service("/copyrights", new pion::plugins::FileService); -+ m_server->set_service_option("/copyrights", "file", DATA_LOCATION "/README"); -+ m_server->add_service("/download", new TransferDownloadService); -+ m_server->add_service("/captcha", new CaptchaService); - - m_server->start(); - Logger::global()->enterLogMessage("HttpService", tr("Listening on port %1").arg(m_port)); -+ std::cout << "Listening on port " << m_port << std::endl; - } - catch(const std::exception& e) - { -+ std::cerr << e.what() << std::endl; - Logger::global()->enterLogMessage("HttpService", tr("Failed to start: %1").arg(e.what())); - } - } -@@ -225,29 +226,29 @@ void HttpService::setupSSL() - if (file.isEmpty() || !QFile::exists(file)) - { - Logger::global()->enterLogMessage("HttpService", tr("SSL key file not found, disabling HTTPS")); -- m_server->setSSLFlag(false); -+ m_server->set_ssl_flag(false); - m_strSSLPem.clear(); - } - else - { - Logger::global()->enterLogMessage("HttpService", tr("Loading a SSL key from %1").arg(file)); - m_strSSLPem = file; -- m_server->setSSLKeyFile(file.toStdString()); -- m_server->setSSLFlag(true); -+ m_server->set_ssl_key_file(file.toStdString()); -+ m_server->set_ssl_flag(true); - } - } - else - { - Logger::global()->enterLogMessage("HttpService", tr("Running in plain HTTP mode")); -- m_server->setSSLFlag(false); -+ m_server->set_ssl_flag(false); - m_strSSLPem.clear(); - } - } - --void HttpService::LogService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::LogService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); -- QString uuidTransfer = QString::fromStdString(getRelativeResource(request->getResource())); -+ pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); -+ QString uuidTransfer = QString::fromStdString(get_relative_resource(request->get_resource())); - QString data; - - if (uuidTransfer.isEmpty()) -@@ -260,8 +261,8 @@ void HttpService::LogService::operator() - - if (!q || !t) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - writer->send(); - return; - } -@@ -272,16 +273,16 @@ void HttpService::LogService::operator() - g_queuesLock.unlock(); - } - -- writer->getResponse().addHeader("Content-Type", "text/plain"); -+ writer->get_response().add_header("Content-Type", "text/plain"); - writer->write(data.toStdString()); - writer->send(); - } - --void HttpService::TransferTreeBrowserService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::TransferTreeBrowserService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); -- QString uuidTransfer = QString::fromStdString(getRelativeResource(request->getResource())); -- QString path = QString::fromStdString(request->getQuery("path")); -+ pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); -+ QString uuidTransfer = QString::fromStdString(get_relative_resource(request->get_resource())); -+ QString path = QString::fromStdString(request->get_query("path")); - - path = path.replace("+", " "); - path = QUrl::fromPercentEncoding(path.toUtf8()); -@@ -294,8 +295,8 @@ void HttpService::TransferTreeBrowserSer - - if (path.contains("/..") || path.contains("../")) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_FORBIDDEN); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_FORBIDDEN); - writer->send(); - return; - } -@@ -304,8 +305,8 @@ void HttpService::TransferTreeBrowserSer - - if (!q || !t) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - writer->send(); - return; - } -@@ -320,8 +321,8 @@ void HttpService::TransferTreeBrowserSer - - if (!dir.cd(path)) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - writer->send(); - return; - } -@@ -371,11 +372,11 @@ void HttpService::TransferTreeBrowserSer - writer->send(); - } - --void HttpService::TransferDownloadService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::TransferDownloadService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); -- QString transfer = QString::fromStdString(request->getQuery("transfer")); -- QString path = QString::fromStdString(request->getQuery("path")); -+ pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); -+ QString transfer = QString::fromStdString(request->get_query("transfer")); -+ QString path = QString::fromStdString(request->get_query("path")); - - path = path.replace("+", " "); - path = QUrl::fromPercentEncoding(path.toUtf8()); -@@ -387,8 +388,8 @@ void HttpService::TransferDownloadServic - - if (path.contains("/..") || path.contains("../")) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_FORBIDDEN); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_FORBIDDEN); - writer->send(); - return; - } -@@ -397,8 +398,8 @@ void HttpService::TransferDownloadServic - - if (!q || !t) - { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - writer->send(); - return; - } -@@ -428,24 +429,24 @@ void HttpService::TransferDownloadServic - response_file.update(); - - pion::plugins::DiskFileSenderPtr sender_ptr(pion::plugins::DiskFileSender::create(response_file, request, tcp_conn, 8192)); -- sender_ptr->getWriter()->getResponse().addHeader("Content-Disposition", disposition.toStdString()); -+ sender_ptr->getWriter()->get_response().add_header("Content-Disposition", disposition.toStdString()); - - if (unsigned long long fileSize = response_file.getFileSize()) - { - std::stringstream fileSizeStream; - fileSizeStream << fileSize; -- sender_ptr->getWriter()->getResponse().addHeader("Content-Length", fileSizeStream.str()); -+ sender_ptr->getWriter()->get_response().add_header("Content-Length", fileSizeStream.str()); - } - - sender_ptr->send(); - } - --void HttpService::SubclassService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::SubclassService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- pion::net::HTTPResponseWriterPtr writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); -+ pion::http::response_writer_ptr writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); - HttpService::WriteBackImpl wb = HttpService::WriteBackImpl(writer); -- QString transfer = QString::fromStdString(request->getQuery("transfer")); -- QString method = QString::fromStdString(getRelativeResource(request->getResource())); -+ QString transfer = QString::fromStdString(request->get_query("transfer")); -+ QString method = QString::fromStdString(get_relative_resource(request->get_resource())); - - Queue* q = 0; - Transfer* t = 0; -@@ -460,15 +461,15 @@ void HttpService::SubclassService::opera - g_queuesLock.unlock(); - } - -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - writer->send(); - return; - } - - QMultiMap<QString,QString> map; -- pion::net::HTTPTypes::QueryParams params = request->getQueryParams(); -- for (pion::net::HTTPTypes::QueryParams::iterator it = params.begin(); it != params.end(); it++) -+ pion::ihash_multimap params = request->get_queries(); -+ for (pion::ihash_multimap::iterator it = params.begin(); it != params.end(); it++) - { - map.insert(QString::fromStdString(it->first), QString::fromStdString(it->second)); - } -@@ -481,7 +482,7 @@ void HttpService::SubclassService::opera - g_queuesLock.unlock(); - } - --HttpService::WriteBackImpl::WriteBackImpl(pion::net::HTTPResponseWriterPtr& writer) -+HttpService::WriteBackImpl::WriteBackImpl(pion::http::response_writer_ptr& writer) - : m_writer(writer) - { - -@@ -489,7 +490,7 @@ HttpService::WriteBackImpl::WriteBackImp - - void HttpService::WriteBackImpl::writeNoCopy(void* data, size_t bytes) - { -- m_writer->writeNoCopy(data, bytes); -+ m_writer->write_no_copy(data, bytes); - } - - void HttpService::WriteBackImpl::send() -@@ -504,13 +505,13 @@ void HttpService::WriteBackImpl::write(c - - void HttpService::WriteBackImpl::setContentType(const char* type) - { -- m_writer->getResponse().addHeader("Content-Type", type); -+ m_writer->get_response().add_header("Content-Type", type); - } - - void HttpService::WriteBackImpl::writeFail(QString error) - { -- m_writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- m_writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -+ m_writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); -+ m_writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); - } - - int HttpService::findTransfer(QString transferUUID, Queue** q, Transfer** t, bool lockForWrite) -@@ -601,9 +602,9 @@ QVariant HttpService::generateCertificat - - - /* --void HttpService::CaptchaService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::CaptchaService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- m_cap.writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); -+ m_cap.writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); - - std::string upgrade, connection; - upgrade = request->getHeader("Upgrade"); -@@ -616,8 +617,8 @@ void HttpService::CaptchaService::operat - - if (connection != "upgrade" || upgrade != "websocket" || m_cap.key1.empty() || m_cap.key2.empty()) - { -- m_cap.writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_BAD_REQUEST); -- m_cap.writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_BAD_REQUEST); -+ m_cap.writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_BAD_REQUEST); -+ m_cap.writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_BAD_REQUEST); - m_cap.writer->send(); - } - -@@ -668,30 +669,30 @@ void HttpService::CaptchaService::CapSer - - */ - --void HttpService::CaptchaHttpResponseWriter::handleWrite(const boost::system::error_code &write_error, std::size_t bytes_written) -+void HttpService::CaptchaHttpResponseWriter::handle_write(const boost::system::error_code &write_error, std::size_t bytes_written) - { - if (!bytes_written) - { - // TODO: handle errors - HttpService::instance()->removeCaptchaClient(client); -- sendFinalChunk(); -+ send_final_chunk(); - delete client; - } - -- pion::net::HTTPResponseWriter::handleWrite(write_error, bytes_written); -+ pion::http::response_writer::handle_write(write_error, bytes_written); - } - --void HttpService::CaptchaService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void HttpService::CaptchaService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- if (request->hasQuery("id")) -+ if (request->has_query("id")) - { -- QString id = QString::fromStdString(request->getQuery("id")); -- QString solution = QString::fromStdString(request->getQuery("solution")); -+ QString id = QString::fromStdString(request->get_query("id")); -+ QString solution = QString::fromStdString(request->get_query("solution")); - - int iid = id.toInt(); - HttpService::instance()->m_captchaHttp.captchaEntered(iid, solution); - -- pion::net::HTTPResponseWriterPtr writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); -+ pion::http::response_writer_ptr writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); - writer->send(); - } - else -@@ -709,13 +710,13 @@ void HttpService::CaptchaService::operat - RegisteredClient* client = new RegisteredClient; - - client->writer = CaptchaHttpResponseWriter::create(client, tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn)); -+ boost::bind(&pion::tcp::connection::finish, tcp_conn)); - HttpService::instance()->addCaptchaClient(client); - -- client->writer->getResponse().addHeader("Content-Type", "text/event-stream"); -- client->writer->getResponse().addHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); -- client->writer->getResponse().addHeader("Expires", "Tue, 03 Jul 2001 06:00:00 GMT"); -- client->writer->getResponse().addHeader("Pragma", "no-cache"); -+ client->writer->get_response().add_header("Content-Type", "text/event-stream"); -+ client->writer->get_response().add_header("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); -+ client->writer->get_response().add_header("Expires", "Tue, 03 Jul 2001 06:00:00 GMT"); -+ client->writer->get_response().add_header("Pragma", "no-cache"); - } - } - -@@ -747,7 +748,7 @@ void HttpService::RegisteredClient::push - writer->clear(); - - writer->write(buf.data(), buf.length()); -- writer->sendChunk(boost::bind(&HttpService::RegisteredClient::finished, this)); -+ writer->send_chunk(boost::bind(&HttpService::RegisteredClient::finished, this)); - } - else - writeInProgressLock.unlock(); -@@ -760,7 +761,7 @@ void HttpService::RegisteredClient::keep - - writer->clear(); - writer->write(": keepalive\r\n\r\n"); -- writer->sendChunk(boost::bind(&HttpService::RegisteredClient::finished, this)); -+ writer->send_chunk(boost::bind(&HttpService::RegisteredClient::finished, this)); - } - - void HttpService::addCaptchaEvent(int id, QString url) -@@ -803,5 +804,5 @@ void HttpService::keepalive() - - void HttpService::RegisteredClient::terminate() - { -- writer->getTCPConnection()->finish(); -+ writer->get_connection()->finish(); - } -diff -rup fatrat-1.2.0_beta2/src/remote/HttpService.h fatrat-1.2.0_beta2.new/src/remote/HttpService.h ---- fatrat-1.2.0_beta2/src/remote/HttpService.h 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/HttpService.h 2013-04-29 19:17:17.076634049 +0100 -@@ -40,7 +40,8 @@ respects for all of the code used other - #include <ctime> - #include <openssl/ssl.h> - #include <boost/system/system_error.hpp> --#include <pion/net/HTTPResponseWriter.hpp> -+#include <pion/http/plugin_server.hpp> -+#include <pion/http/response_writer.hpp> - #include "captcha/CaptchaHttp.h" - #include "remote/TransferHttpService.h" - -@@ -48,7 +49,8 @@ respects for all of the code used other - # error This file is not supposed to be included! - #endif - --#include <pion/net/WebServer.hpp> -+#include <pion/http/server.hpp> -+#include <pion/http/plugin_service.hpp> - - class Queue; - class Transfer; -@@ -83,8 +85,8 @@ private: - void killCaptchaClients(); - private: - static HttpService* m_instance; -- pion::net::WebServer* m_server; -- pion::net::HTTPAuthPtr m_auth_ptr; -+ pion::http::plugin_server* m_server; -+ pion::http::auth_ptr m_auth_ptr; - CaptchaHttp m_captchaHttp; - quint16 m_port; - QString m_strSSLPem; -@@ -94,27 +96,27 @@ private: - QList<RegisteredClient*> m_registeredCaptchaClients; - QMutex m_registeredCaptchaClientsMutex; - -- class LogService : public pion::net::WebService -+ class LogService : public pion::http::plugin_service - { -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - }; -- class TransferTreeBrowserService : public pion::net::WebService -+ class TransferTreeBrowserService : public pion::http::plugin_service - { -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - }; -- class TransferDownloadService : public pion::net::WebService -+ class TransferDownloadService : public pion::http::plugin_service - { -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - }; -- class SubclassService : public pion::net::WebService -+ class SubclassService : public pion::http::plugin_service - { - public: -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - }; -- /*class CaptchaService : public pion::net::WebService -+ /*class CaptchaService : public pion::http::plugin_service - { - public: -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - private: - class CapServCap - { -@@ -126,15 +128,15 @@ private: - std::string key1, key2; - char sig[8]; - int inbuf; -- pion::net::TCPConnectionPtr tcp_conn; -+ pion::tcp::connection_ptr tcp_conn; - } m_cap; - };*/ - - class CaptchaHttpResponseWriter; -- class CaptchaService : public pion::net::WebService -+ class CaptchaService : public pion::http::plugin_service - { - public: -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - }; - struct RegisteredClient - { -@@ -151,16 +153,16 @@ private: - void terminate(); - }; - -- class CaptchaHttpResponseWriter : public pion::net::HTTPResponseWriter -+ class CaptchaHttpResponseWriter : public pion::http::response_writer - { - public: -- CaptchaHttpResponseWriter(HttpService::RegisteredClient* cl, pion::net::TCPConnectionPtr &tcp_conn, const pion::net::HTTPRequest& request, FinishedHandler handler = FinishedHandler()) -- : pion::net::HTTPResponseWriter(tcp_conn, request, handler), client(cl) -+ CaptchaHttpResponseWriter(HttpService::RegisteredClient* cl, pion::tcp::connection_ptr &tcp_conn, const pion::http::request& request, finished_handler_t handler = finished_handler_t()) -+ : pion::http::response_writer(tcp_conn, request, handler), client(cl) - { - - } - -- static inline boost::shared_ptr<CaptchaHttpResponseWriter> create(HttpService::RegisteredClient* cl, pion::net::TCPConnectionPtr &tcp_conn, const pion::net::HTTPRequest& request, FinishedHandler handler = FinishedHandler()) -+ static inline boost::shared_ptr<CaptchaHttpResponseWriter> create(HttpService::RegisteredClient* cl, pion::tcp::connection_ptr &tcp_conn, const pion::http::request& request, finished_handler_t handler = finished_handler_t()) - { - return boost::shared_ptr<CaptchaHttpResponseWriter>(new CaptchaHttpResponseWriter(cl, tcp_conn, request, handler)); - } -@@ -171,7 +173,7 @@ private: - m_http_response->prepareBuffersForSend(write_buffers, getTCPConnection()->getKeepAlive(), - sendingChunkedMessage()); - }*/ -- virtual void handleWrite(const boost::system::error_code &write_error, std::size_t bytes_written); -+ virtual void handle_write(const boost::system::error_code &write_error, std::size_t bytes_written); - - HttpService::RegisteredClient* client; - }; -@@ -179,14 +181,14 @@ private: - class WriteBackImpl : public TransferHttpService::WriteBack - { - public: -- WriteBackImpl(pion::net::HTTPResponseWriterPtr& writer); -+ WriteBackImpl(pion::http::response_writer_ptr& writer); - void write(const char* data, size_t bytes); - void writeFail(QString error); - void writeNoCopy(void* data, size_t bytes); - void send(); - void setContentType(const char* type); - private: -- pion::net::HTTPResponseWriterPtr m_writer; -+ pion::http::response_writer_ptr m_writer; - }; - }; - -diff -rup fatrat-1.2.0_beta2/src/remote/pion/FileService.cpp fatrat-1.2.0_beta2.new/src/remote/pion/FileService.cpp ---- fatrat-1.2.0_beta2/src/remote/pion/FileService.cpp 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/pion/FileService.cpp 2013-04-29 19:17:17.079967487 +0100 -@@ -15,13 +15,14 @@ - #include <boost/algorithm/string/case_conv.hpp> - - #include "FileService.hpp" --#include <pion/PionPlugin.hpp> --#include <pion/net/HTTPResponseWriter.hpp> -+#include <pion/plugin.hpp> -+#include <pion/http/response_writer.hpp> - #include <sstream> - #include <QFileInfo> - - using namespace pion; --using namespace pion::net; -+using namespace pion::http; -+using namespace pion::tcp; - - namespace pion { // begin namespace pion - namespace plugins { // begin namespace plugins -@@ -49,7 +50,7 @@ FileService::FileService(void) - m_writable(false) - {} - --void FileService::setOption(const std::string& name, const std::string& value) -+void FileService::set_option(const std::string& name, const std::string& value) - { - if (name == "directory") { - m_directory = value; -@@ -104,10 +105,10 @@ void FileService::setOption(const std::s - } - } - --void FileService::operator()(HTTPRequestPtr& request, TCPConnectionPtr& tcp_conn) -+void FileService::operator()(request_ptr& request, connection_ptr& tcp_conn) - { - // get the relative resource path for the request -- const std::string relative_path(getRelativeResource(request->getResource())); -+ const std::string relative_path(get_relative_resource(request->get_resource())); - - // determine the path of the file being requested - boost::filesystem::path file_path; -@@ -117,7 +118,7 @@ void FileService::operator()(HTTPRequest - if (m_file.empty()) { - // no file is specified, either in the request or in the options - PION_LOG_WARN(m_logger, "No file option defined (" -- << getResource() << ")"); -+ << get_resource() << ")"); - sendNotFoundResponse(request, tcp_conn); - return; - } else { -@@ -129,7 +130,7 @@ void FileService::operator()(HTTPRequest - if (m_directory.empty()) { - // no directory is specified for the relative file - PION_LOG_WARN(m_logger, "No directory option defined (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - sendNotFoundResponse(request, tcp_conn); - return; - } else { -@@ -142,7 +143,7 @@ void FileService::operator()(HTTPRequest - std::string string = file_path.string(); - if (string.find(m_directory.string()) != 0) { - PION_LOG_WARN(m_logger, "Request for file outside of directory (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - static const std::string FORBIDDEN_HTML_START = - "<html><head>\n" - "<title>403 Forbidden</title>\n" -@@ -152,14 +153,14 @@ void FileService::operator()(HTTPRequest - static const std::string FORBIDDEN_HTML_FINISH = - " is not in the configured directory.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); -- if (request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { -- writer->writeNoCopy(FORBIDDEN_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(FORBIDDEN_HTML_FINISH); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_FORBIDDEN); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_FORBIDDEN); -+ if (request->get_method() != types::REQUEST_METHOD_HEAD) { -+ writer->write_no_copy(FORBIDDEN_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(FORBIDDEN_HTML_FINISH); - } - writer->send(); - return; -@@ -168,7 +169,7 @@ void FileService::operator()(HTTPRequest - // requests specifying directories are not allowed - if (boost::filesystem::is_directory(file_path)) { - PION_LOG_WARN(m_logger, "Request for directory (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - static const std::string FORBIDDEN_HTML_START = - "<html><head>\n" - "<title>403 Forbidden</title>\n" -@@ -178,21 +179,21 @@ void FileService::operator()(HTTPRequest - static const std::string FORBIDDEN_HTML_FINISH = - " is a directory.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); -- if (request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { -- writer->writeNoCopy(FORBIDDEN_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(FORBIDDEN_HTML_FINISH); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_FORBIDDEN); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_FORBIDDEN); -+ if (request->get_method() != types::REQUEST_METHOD_HEAD) { -+ writer->write_no_copy(FORBIDDEN_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(FORBIDDEN_HTML_FINISH); - } - writer->send(); - return; - } - -- if (request->getMethod() == HTTPTypes::REQUEST_METHOD_GET -- || request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) -+ if (request->get_method() == types::REQUEST_METHOD_GET -+ || request->get_method() == types::REQUEST_METHOD_HEAD) - { - // the type of response we will send - enum ResponseType { -@@ -207,7 +208,7 @@ void FileService::operator()(HTTPRequest - DiskFile response_file; - - // get the If-Modified-Since request header -- const std::string if_modified_since(request->getHeader(HTTPTypes::HEADER_IF_MODIFIED_SINCE)); -+ const std::string if_modified_since(request->get_header(types::HEADER_IF_MODIFIED_SINCE)); - - // check the cache for a corresponding entry (if enabled) - // note that m_cache_setting may equal 0 if m_scan_setting == 1 -@@ -225,18 +226,18 @@ void FileService::operator()(HTTPRequest - // all requests must correspond with existing cache entries - // since no match was found, just return file not found - PION_LOG_WARN(m_logger, "Request for unknown file (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - response_type = RESPONSE_NOT_FOUND; - } else { - PION_LOG_DEBUG(m_logger, "No cache entry for request (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - } - - } else { - // found an existing cache entry - - PION_LOG_DEBUG(m_logger, "Found cache entry for request (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - - if (m_cache_setting == 0) { - // cache is disabled -@@ -253,12 +254,12 @@ void FileService::operator()(HTTPRequest - // no need to read the file; the modified times match! - response_type = RESPONSE_NOT_MODIFIED; - } else { -- if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { -+ if (request->get_method() == types::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; - PION_LOG_DEBUG(m_logger, "Cache disabled, reading file (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - } - } - -@@ -290,7 +291,7 @@ void FileService::operator()(HTTPRequest - // get the response type - if (cache_itr->second.getLastModifiedString() == if_modified_since) { - response_type = RESPONSE_NOT_MODIFIED; -- } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { -+ } else if (request->get_method() == types::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; -@@ -301,7 +302,7 @@ void FileService::operator()(HTTPRequest - - PION_LOG_DEBUG(m_logger, (cache_was_updated ? "Updated" : "Using") - << " cache entry for request (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - } - } - } -@@ -310,7 +311,7 @@ void FileService::operator()(HTTPRequest - // make sure that the file exists - if (! boost::filesystem::exists(file_path)) { - PION_LOG_WARN(m_logger, "File not found (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - sendNotFoundResponse(request, tcp_conn); - return; - } -@@ -318,7 +319,7 @@ void FileService::operator()(HTTPRequest - response_file.setFilePath(file_path); - - PION_LOG_DEBUG(m_logger, "Found file for request (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - - // determine the MIME type - response_file.setMimeType(findMIMEType( response_file.getFilePath().string() )); -@@ -330,7 +331,7 @@ void FileService::operator()(HTTPRequest - if (response_file.getLastModifiedString() == if_modified_since) { - // no need to read the file; the modified times match! - response_type = RESPONSE_NOT_MODIFIED; -- } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { -+ } else if (request->get_method() == types::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; -@@ -341,7 +342,7 @@ void FileService::operator()(HTTPRequest - } - // add new entry to the cache - PION_LOG_DEBUG(m_logger, "Adding cache entry for request (" -- << getResource() << "): " << relative_path); -+ << get_resource() << "): " << relative_path); - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - m_cache_map.insert( std::make_pair(relative_path, response_file) ); - } -@@ -360,43 +361,43 @@ void FileService::operator()(HTTPRequest - // sending headers only -> use our own response object - - // prepare a response and set the Content-Type -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setContentType(response_file.getMimeType()); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_content_type(response_file.getMimeType()); - - // set Last-Modified header to enable client-side caching -- writer->getResponse().addHeader(HTTPTypes::HEADER_LAST_MODIFIED, -+ writer->get_response().add_header(types::HEADER_LAST_MODIFIED, - response_file.getLastModifiedString()); - - std::stringstream out; - out << response_file.getFileSize(); -- writer->getResponse().addHeader(HTTPTypes::HEADER_CONTENT_LENGTH, out.str()); -+ writer->get_response().add_header(types::HEADER_CONTENT_LENGTH, out.str()); - - switch(response_type) { - case RESPONSE_UNDEFINED: - case RESPONSE_NOT_FOUND: - case RESPONSE_OK: - // this should never happen -- throw UndefinedResponseException(request->getResource()); -+ throw UndefinedResponseException(request->get_resource()); - break; - case RESPONSE_NOT_MODIFIED: - // set "Not Modified" response -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_MODIFIED); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_MODIFIED); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NOT_MODIFIED); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NOT_MODIFIED); - break; - case RESPONSE_HEAD_OK: - // set "OK" response (not really necessary since this is the default) -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_OK); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_OK); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_OK); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_OK); - break; - } - - // send the response - writer->send(); - } -- } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_POST -- || request->getMethod() == HTTPTypes::REQUEST_METHOD_PUT -- || request->getMethod() == HTTPTypes::REQUEST_METHOD_DELETE) -+ } else if (request->get_method() == types::REQUEST_METHOD_POST -+ || request->get_method() == types::REQUEST_METHOD_PUT -+ || request->get_method() == types::REQUEST_METHOD_DELETE) - { - // If not writable, then send 405 (Method Not Allowed) response for POST, PUT or DELETE requests. - if (!m_writable) { -@@ -409,24 +410,24 @@ void FileService::operator()(HTTPRequest - static const std::string NOT_ALLOWED_HTML_FINISH = - " is not allowed on this server.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_METHOD_NOT_ALLOWED); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); -- writer->writeNoCopy(NOT_ALLOWED_HTML_START); -- writer << request->getMethod(); -- writer->writeNoCopy(NOT_ALLOWED_HTML_FINISH); -- writer->getResponse().addHeader("Allow", "GET, HEAD"); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_METHOD_NOT_ALLOWED); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); -+ writer->write_no_copy(NOT_ALLOWED_HTML_START); -+ writer << request->get_method(); -+ writer->write_no_copy(NOT_ALLOWED_HTML_FINISH); -+ writer->get_response().add_header("Allow", "GET, HEAD"); - writer->send(); - } else { -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- if (request->getMethod() == HTTPTypes::REQUEST_METHOD_POST -- || request->getMethod() == HTTPTypes::REQUEST_METHOD_PUT) -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ if (request->get_method() == types::REQUEST_METHOD_POST -+ || request->get_method() == types::REQUEST_METHOD_PUT) - { - if (boost::filesystem::exists(file_path)) { -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NO_CONTENT); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NO_CONTENT); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NO_CONTENT); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NO_CONTENT); - } else { - // The file doesn't exist yet, so it will be created below, unless the - // directory of the requested file also doesn't exist. -@@ -440,11 +441,11 @@ void FileService::operator()(HTTPRequest - static const std::string NOT_FOUND_HTML_FINISH = - " was not found on this server.</p>\n" - "</body></html>\n"; -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -- writer->writeNoCopy(NOT_FOUND_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(NOT_FOUND_HTML_FINISH); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NOT_FOUND); -+ writer->write_no_copy(NOT_FOUND_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(NOT_FOUND_HTML_FINISH); - writer->send(); - return; - } -@@ -457,17 +458,17 @@ void FileService::operator()(HTTPRequest - static const std::string CREATED_HTML_FINISH = - "</p>\n" - "</body></html>\n"; -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_CREATED); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_CREATED); -- writer->getResponse().addHeader(HTTPTypes::HEADER_LOCATION, request->getResource()); -- writer->writeNoCopy(CREATED_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(CREATED_HTML_FINISH); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_CREATED); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_CREATED); -+ writer->get_response().add_header(types::HEADER_LOCATION, request->get_resource()); -+ writer->write_no_copy(CREATED_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(CREATED_HTML_FINISH); - } -- std::ios_base::openmode mode = request->getMethod() == HTTPTypes::REQUEST_METHOD_POST? -+ std::ios_base::openmode mode = request->get_method() == types::REQUEST_METHOD_POST? - std::ios::app : std::ios::out; - boost::filesystem::ofstream file_stream(file_path, mode); -- file_stream.write(request->getContent(), request->getContentLength()); -+ file_stream.write(request->get_content(), request->get_content_length()); - file_stream.close(); - if (!boost::filesystem::exists(file_path)) { - static const std::string PUT_FAILED_HTML_START = -@@ -479,21 +480,21 @@ void FileService::operator()(HTTPRequest - static const std::string PUT_FAILED_HTML_FINISH = - ".</p>\n" - "</body></html>\n"; -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); -- writer->writeNoCopy(PUT_FAILED_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(PUT_FAILED_HTML_FINISH); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_SERVER_ERROR); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_SERVER_ERROR); -+ writer->write_no_copy(PUT_FAILED_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(PUT_FAILED_HTML_FINISH); - } - writer->send(); -- } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_DELETE) { -+ } else if (request->get_method() == types::REQUEST_METHOD_DELETE) { - if (!boost::filesystem::exists(file_path)) { - sendNotFoundResponse(request, tcp_conn); - } else { - try { - boost::filesystem::remove(file_path); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NO_CONTENT); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NO_CONTENT); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NO_CONTENT); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NO_CONTENT); - writer->send(); - } catch (...) { - static const std::string DELETE_FAILED_HTML_START = -@@ -505,18 +506,18 @@ void FileService::operator()(HTTPRequest - static const std::string DELETE_FAILED_HTML_FINISH = - ".</p>\n" - "</body></html>\n"; -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); -- writer->writeNoCopy(DELETE_FAILED_HTML_START); -- writer << request->getResource(); -- writer->writeNoCopy(DELETE_FAILED_HTML_FINISH); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_SERVER_ERROR); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_SERVER_ERROR); -+ writer->write_no_copy(DELETE_FAILED_HTML_START); -+ writer << request->get_resource(); -+ writer->write_no_copy(DELETE_FAILED_HTML_FINISH); - writer->send(); - } - } - } else { - // This should never be reached. -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_SERVER_ERROR); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_SERVER_ERROR); - writer->send(); - } - } -@@ -532,19 +533,19 @@ void FileService::operator()(HTTPRequest - static const std::string NOT_IMPLEMENTED_HTML_FINISH = - " is not implemented on this server.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_IMPLEMENTED); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_IMPLEMENTED); -- writer->writeNoCopy(NOT_IMPLEMENTED_HTML_START); -- writer << request->getMethod(); -- writer->writeNoCopy(NOT_IMPLEMENTED_HTML_FINISH); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NOT_IMPLEMENTED); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NOT_IMPLEMENTED); -+ writer->write_no_copy(NOT_IMPLEMENTED_HTML_START); -+ writer << request->get_method(); -+ writer->write_no_copy(NOT_IMPLEMENTED_HTML_FINISH); - writer->send(); - } - } - --void FileService::sendNotFoundResponse(HTTPRequestPtr& http_request, -- TCPConnectionPtr& tcp_conn) -+void FileService::sendNotFoundResponse(request_ptr& http_request, -+ connection_ptr& tcp_conn) - { - static const std::string NOT_FOUND_HTML_START = - "<html><head>\n" -@@ -555,21 +556,21 @@ void FileService::sendNotFoundResponse(H - static const std::string NOT_FOUND_HTML_FINISH = - " was not found on this server.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *http_request, -- boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); -- if (http_request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { -- writer->writeNoCopy(NOT_FOUND_HTML_START); -- writer << http_request->getResource(); -- writer->writeNoCopy(NOT_FOUND_HTML_FINISH); -+ response_writer_ptr writer(response_writer::create(tcp_conn, *http_request, -+ boost::bind(&connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_NOT_FOUND); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_NOT_FOUND); -+ if (http_request->get_method() != types::REQUEST_METHOD_HEAD) { -+ writer->write_no_copy(NOT_FOUND_HTML_START); -+ writer << http_request->get_resource(); -+ writer->write_no_copy(NOT_FOUND_HTML_FINISH); - } - writer->send(); - } - - void FileService::start(void) - { -- PION_LOG_DEBUG(m_logger, "Starting up resource (" << getResource() << ')'); -+ PION_LOG_DEBUG(m_logger, "Starting up resource (" << get_resource() << ')'); - - // scan directory/file if scan setting != 0 - if (m_scan_setting != 0) { -@@ -594,7 +595,7 @@ void FileService::start(void) - - void FileService::stop(void) - { -- PION_LOG_DEBUG(m_logger, "Shutting down resource (" << getResource() << ')'); -+ PION_LOG_DEBUG(m_logger, "Shutting down resource (" << get_resource() << ')'); - // clear cached files (if started again, it will re-scan) - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - m_cache_map.clear(); -@@ -602,7 +603,7 @@ void FileService::stop(void) - - void FileService::scanDirectory(const boost::filesystem::path& dir_path) - { -- PION_LOG_DEBUG(m_logger, "Scanning directory (" << getResource() << "): " -+ PION_LOG_DEBUG(m_logger, "Scanning directory (" << get_resource() << "): " - << dir_path.string()); - - // iterate through items in the directory -@@ -705,7 +706,7 @@ void DiskFile::update(void) - // set file_size and last_modified - m_file_size = QFileInfo(QString::fromStdString(m_file_path.string())).size(); - m_last_modified = boost::filesystem::last_write_time( m_file_path ); -- m_last_modified_string = HTTPTypes::get_date_string( m_last_modified ); -+ m_last_modified_string = types::get_date_string( m_last_modified ); - } - - void DiskFile::read(void) -@@ -737,7 +738,7 @@ bool DiskFile::checkUpdated(void) - // update file_size and last_modified timestamp - m_file_size = cur_size; - m_last_modified = cur_modified; -- m_last_modified_string = HTTPTypes::get_date_string( m_last_modified ); -+ m_last_modified_string = types::get_date_string( m_last_modified ); - - // read new contents - read(); -@@ -748,11 +749,11 @@ bool DiskFile::checkUpdated(void) - - // DiskFileSender member functions - --DiskFileSender::DiskFileSender(DiskFile& file, pion::net::HTTPRequestPtr& request, -- pion::net::TCPConnectionPtr& tcp_conn, -+DiskFileSender::DiskFileSender(DiskFile& file, pion::http::request_ptr& request, -+ pion::tcp::connection_ptr& tcp_conn, - unsigned long max_chunk_size) - : m_logger(PION_GET_LOGGER("pion.FileService.DiskFileSender")), m_disk_file(file), -- m_writer(pion::net::HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))), -+ m_writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&connection::finish, tcp_conn))), - m_max_chunk_size(max_chunk_size), m_file_bytes_to_send(0), m_bytes_sent(0) - { - PION_LOG_DEBUG(m_logger, "Preparing to send file" -@@ -760,15 +761,15 @@ DiskFileSender::DiskFileSender(DiskFile& - << m_disk_file.getFilePath().string()); - - // set the Content-Type HTTP header using the file's MIME type -- m_writer->getResponse().setContentType(m_disk_file.getMimeType()); -+ m_writer->get_response().set_content_type(m_disk_file.getMimeType()); - - // set Last-Modified header to enable client-side caching -- m_writer->getResponse().addHeader(HTTPTypes::HEADER_LAST_MODIFIED, -+ m_writer->get_response().add_header(types::HEADER_LAST_MODIFIED, - m_disk_file.getLastModifiedString()); - - // use "200 OK" HTTP response -- m_writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_OK); -- m_writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_OK); -+ m_writer->get_response().set_status_code(types::RESPONSE_CODE_OK); -+ m_writer->get_response().set_status_message(types::RESPONSE_MESSAGE_OK); - } - - void DiskFileSender::send(void) -@@ -827,13 +828,13 @@ void DiskFileSender::send(void) - } - - // send the content -- m_writer->writeNoCopy(file_content_ptr, m_file_bytes_to_send); -+ m_writer->write_no_copy(file_content_ptr, m_file_bytes_to_send); - - if (m_bytes_sent + m_file_bytes_to_send >= m_disk_file.getFileSize()) { - // this is the last piece of data to send - if (m_bytes_sent > 0) { - // send last chunk in a series -- m_writer->sendFinalChunk(boost::bind(&DiskFileSender::handleWrite, -+ m_writer->send_final_chunk(boost::bind(&DiskFileSender::handleWrite, - shared_from_this(), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); -@@ -846,7 +847,7 @@ void DiskFileSender::send(void) - } - } else { - // there will be more data -> send a chunk -- m_writer->sendChunk(boost::bind(&DiskFileSender::handleWrite, -+ m_writer->send_chunk(boost::bind(&DiskFileSender::handleWrite, - shared_from_this(), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); -@@ -860,7 +861,7 @@ void DiskFileSender::handleWrite(const b - - if (write_error) { - // encountered error sending response data -- m_writer->getTCPConnection()->setLifecycle(TCPConnection::LIFECYCLE_CLOSE); // make sure it will get closed -+ m_writer->get_connection()->set_lifecycle(connection::LIFECYCLE_CLOSE); // make sure it will get closed - PION_LOG_WARN(m_logger, "Error sending file (" << write_error.message() << ')'); - } else { - // response data sent OK -@@ -874,7 +875,7 @@ void DiskFileSender::handleWrite(const b - PION_LOG_DEBUG(m_logger, "Sent " - << (m_file_bytes_to_send < m_disk_file.getFileSize() ? "file chunk" : "complete file") - << " of " << m_file_bytes_to_send << " bytes (finished" -- << (m_writer->getTCPConnection()->getKeepAlive() ? ", keeping alive)" : ", closing)") ); -+ << (m_writer->get_connection()->get_keep_alive() ? ", keeping alive)" : ", closing)") ); - } else { - // NOT finished sending - PION_LOG_DEBUG(m_logger, "Sent file chunk of " << m_file_bytes_to_send << " bytes"); -@@ -884,10 +885,10 @@ void DiskFileSender::handleWrite(const b - } - - if (finished_sending) { -- // TCPConnection::finish() calls TCPServer::finishConnection, which will either: -+ // connection::finish() calls TCPServer::finishConnection, which will either: - // a) call HTTPServer::handleConnection again if keep-alive is true; or, - // b) close the socket and remove it from the server's connection pool -- m_writer->getTCPConnection()->finish(); -+ m_writer->get_connection()->finish(); - } else { - send(); - } -@@ -897,7 +898,7 @@ void DiskFileSender::handleWrite(const b - } // end namespace plugins - } // end namespace pion - -- -+#if 0 - /// creates new FileService objects - extern "C" PION_SERVICE_API pion::plugins::FileService *pion_create_FileService(void) - { -@@ -909,3 +910,5 @@ extern "C" PION_SERVICE_API void pion_de - { - delete service_ptr; - } -+#endif -+ -diff -rup fatrat-1.2.0_beta2/src/remote/pion/FileService.hpp fatrat-1.2.0_beta2.new/src/remote/pion/FileService.hpp ---- fatrat-1.2.0_beta2/src/remote/pion/FileService.hpp 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/pion/FileService.hpp 2013-04-29 19:17:17.079967487 +0100 -@@ -16,13 +16,13 @@ - #include <boost/thread/once.hpp> - #include <boost/thread/mutex.hpp> - #include <boost/shared_array.hpp> --#include <pion/PionLogger.hpp> --#include <pion/PionException.hpp> --#include <pion/PionHashMap.hpp> --#include <pion/net/WebService.hpp> --#include <pion/net/HTTPRequest.hpp> --#include <pion/net/HTTPResponseWriter.hpp> --#include <pion/net/HTTPServer.hpp> -+#include <pion/logger.hpp> -+#include <pion/error.hpp> -+#include <pion/hash_map.hpp> -+#include <pion/http/plugin_service.hpp> -+#include <pion/http/request.hpp> -+#include <pion/http/response_writer.hpp> -+#include <pion/http/server.hpp> - #include <string> - #include <map> - -@@ -144,8 +144,8 @@ public: - */ - static inline boost::shared_ptr<DiskFileSender> - create(DiskFile& file, -- pion::net::HTTPRequestPtr& request, -- pion::net::TCPConnectionPtr& tcp_conn, -+ pion::http::request_ptr& request, -+ pion::tcp::connection_ptr& tcp_conn, - unsigned long max_chunk_size = 0) - { - return boost::shared_ptr<DiskFileSender>(new DiskFileSender(file, request, -@@ -161,11 +161,11 @@ public: - void send(void); - - /// sets the logger to be used -- inline void setLogger(PionLogger log_ptr) { m_logger = log_ptr; } -+ inline void setLogger(pion::logger log_ptr) { m_logger = log_ptr; } - - /// returns the logger currently in use -- inline PionLogger getLogger(void) { return m_logger; } -- inline pion::net::HTTPResponseWriterPtr getWriter() { return m_writer; } -+ inline pion::logger getLogger(void) { return m_logger; } -+ inline pion::http::response_writer_ptr getWriter() { return m_writer; } - - - protected: -@@ -179,8 +179,8 @@ protected: - * @param max_chunk_size sets the maximum chunk size - */ - DiskFileSender(DiskFile& file, -- pion::net::HTTPRequestPtr& request, -- pion::net::TCPConnectionPtr& tcp_conn, -+ pion::http::request_ptr& request, -+ pion::tcp::connection_ptr& tcp_conn, - unsigned long max_chunk_size); - - /** -@@ -194,7 +194,7 @@ protected: - - - /// primary logging interface used by this class -- PionLogger m_logger; -+ pion::logger m_logger; - - - private: -@@ -203,7 +203,7 @@ private: - DiskFile m_disk_file; - - /// the HTTP response we are sending -- pion::net::HTTPResponseWriterPtr m_writer; -+ pion::http::response_writer_ptr m_writer; - - /// used to read the file from disk if it is not already cached in memory - boost::filesystem::ifstream m_file_stream; -@@ -233,73 +233,78 @@ typedef boost::shared_ptr<DiskFileSender - /// FileService: web service that serves regular files - /// - class FileService : -- public pion::net::WebService -+ public pion::http::plugin_service - { - public: - - /// exception thrown if the directory configured is not found -- class DirectoryNotFoundException : public PionException { -+ class DirectoryNotFoundException : public pion::exception { - public: - DirectoryNotFoundException(const std::string& dir) -- : PionException("FileService directory not found: ", dir) {} -+ : pion::exception("FileService directory not found") {} - }; - - /// exception thrown if the directory configuration option is not a directory -- class NotADirectoryException : public PionException { -+ class NotADirectoryException : public pion::exception { - public: - NotADirectoryException(const std::string& dir) -- : PionException("FileService option is not a directory: ", dir) {} -+ : pion::exception("FileService option is not a directory") {} - }; - - /// exception thrown if the file configured is not found -- class FileNotFoundException : public PionException { -+ class FileNotFoundException : public pion::exception { - public: - FileNotFoundException(const std::string& file) -- : PionException("FileService file not found: ", file) {} -+ : pion::exception("FileService file not found") {} - }; - - /// exception thrown if the file configuration option is not a file -- class NotAFileException : public PionException { -+ class NotAFileException : public pion::exception { - public: - NotAFileException(const std::string& file) -- : PionException("FileService option is not a file: ", file) {} -+ : pion::exception("FileService option is not a file") {} - }; - - /// exception thrown if the cache option is set to an invalid value -- class InvalidCacheException : public PionException { -+ class InvalidCacheException : public pion::exception { - public: - InvalidCacheException(const std::string& value) -- : PionException("FileService invalid value for cache option: ", value) {} -+ : pion::exception("FileService invalid value for cache option") {} - }; - - /// exception thrown if the scan option is set to an invalid value -- class InvalidScanException : public PionException { -+ class InvalidScanException : public pion::exception { - public: - InvalidScanException(const std::string& value) -- : PionException("FileService invalid value for scan option: ", value) {} -+ : pion::exception("FileService invalid value for scan option") {} - }; - - /// exception thrown if an option is set to an invalid value -- class InvalidOptionValueException : public PionException { -+ class InvalidOptionValueException : public pion::exception { - public: - InvalidOptionValueException(const std::string& option, const std::string& value) -- : PionException("FileService invalid value for " + option + " option: ", value) {} -+ : pion::exception("FileService invalid value for " + option + " option") {} - }; - - /// exception thrown if we are unable to read a file from disk -- class FileReadException : public PionException { -+ class FileReadException : public pion::exception { - public: - FileReadException(const std::string& value) -- : PionException("FileService unable to read file: ", value) {} -+ : pion::exception("FileService unable to read file: "+value) {} - }; - - /// exception thrown if we do not know how to respond (should never happen) -- class UndefinedResponseException : public PionException { -+ class UndefinedResponseException : public pion::exception { - public: - UndefinedResponseException(const std::string& value) -- : PionException("FileService has an undefined response: ", value) {} -+ : pion::exception("FileService has an undefined response: "+value) {} - }; - -+ class UnknownOptionException : public pion::exception { -+ public: -+ UnknownOptionException(const std::string& value) -+ : pion::exception("FileService invalid option name: "+value) {} -+ }; - - // default constructor and destructor - FileService(void); -@@ -315,11 +320,11 @@ public: - * max_chunk_size: - * writable: - */ -- virtual void setOption(const std::string& name, const std::string& value); -+ virtual void set_option(const std::string& name, const std::string& value); - - /// handles requests for FileService -- virtual void operator()(pion::net::HTTPRequestPtr& request, -- pion::net::TCPConnectionPtr& tcp_conn); -+ virtual void operator()(pion::http::request_ptr& request, -+ pion::tcp::connection_ptr& tcp_conn); - - /// called when the web service's server is starting - virtual void start(void); -@@ -328,10 +333,10 @@ public: - virtual void stop(void); - - /// sets the logger to be used -- inline void setLogger(PionLogger log_ptr) { m_logger = log_ptr; } -+ inline void setLogger(pion::logger log_ptr) { m_logger = log_ptr; } - - /// returns the logger currently in use -- inline PionLogger getLogger(void) { return m_logger; } -+ inline pion::logger getLogger(void) { return m_logger; } - - - protected: -@@ -372,11 +377,11 @@ protected: - */ - static std::string findMIMEType(const std::string& file_name); - -- void sendNotFoundResponse(pion::net::HTTPRequestPtr& http_request, -- pion::net::TCPConnectionPtr& tcp_conn); -+ void sendNotFoundResponse(pion::http::request_ptr& http_request, -+ pion::tcp::connection_ptr& tcp_conn); - - /// primary logging interface used by this class -- PionLogger m_logger; -+ pion::logger m_logger; - - - private: -diff -rup fatrat-1.2.0_beta2/src/remote/XmlRpcService.cpp fatrat-1.2.0_beta2.new/src/remote/XmlRpcService.cpp ---- fatrat-1.2.0_beta2/src/remote/XmlRpcService.cpp 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/XmlRpcService.cpp 2013-04-29 19:17:17.079967487 +0100 -@@ -37,10 +37,10 @@ respects for all of the code used other - #include <QStringList> - #include <QFileInfo> - #include <QTemporaryFile> --#include <pion/net/HTTPResponseWriter.hpp> -+#include <pion/http/response_writer.hpp> - #include <QtDebug> - --using namespace pion::net; -+using namespace pion::http; - - extern QList<Queue*> g_queues; - extern QReadWriteLock g_queuesLock; -@@ -151,9 +151,9 @@ void XmlRpcService::globalInit() - - } - --void XmlRpcService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) -+void XmlRpcService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) - { -- if (request->getMethod() != pion::net::HTTPTypes::REQUEST_METHOD_POST) -+ if (request->get_method() != pion::http::types::REQUEST_METHOD_POST) - { - static const std::string NOT_ALLOWED_HTML_START = - "<html><head>\n" -@@ -164,20 +164,20 @@ void XmlRpcService::operator()(pion::net - static const std::string NOT_ALLOWED_HTML_FINISH = - " is not allowed on this server.</p>\n" - "</body></html>\n"; -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); -- writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_METHOD_NOT_ALLOWED); -- writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); -- writer->writeNoCopy(NOT_ALLOWED_HTML_START); -- writer << request->getMethod(); -- writer->writeNoCopy(NOT_ALLOWED_HTML_FINISH); -- writer->getResponse().addHeader("Allow", "GET, HEAD"); -+ pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); -+ writer->get_response().set_status_code(types::RESPONSE_CODE_METHOD_NOT_ALLOWED); -+ writer->get_response().set_status_message(types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); -+ writer->write_no_copy(NOT_ALLOWED_HTML_START); -+ writer << request->get_method(); -+ writer->write_no_copy(NOT_ALLOWED_HTML_FINISH); -+ writer->get_response().add_header("Allow", "GET, HEAD"); - writer->send(); - return; - } - - QByteArray data; - -- qDebug() << "XML-RPC call:" << request->getContent(); -+ qDebug() << "XML-RPC call:" << request->get_content(); - - try - { -@@ -185,7 +185,7 @@ void XmlRpcService::operator()(pion::net - QList<QVariant> args; - QVariant returnValue; - -- XmlRpc::parseCall(request->getContent(), function, args); -+ XmlRpc::parseCall(request->get_content(), function, args); - - if(function == "Queue.getTransfers") - { -@@ -240,7 +240,7 @@ void XmlRpcService::operator()(pion::net - throw "400 Bad Request"; - } - -- HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); -+ pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); - writer->write(data.data(), data.size()); - writer->send(); - } -diff -rup fatrat-1.2.0_beta2/src/remote/XmlRpcService.h fatrat-1.2.0_beta2.new/src/remote/XmlRpcService.h ---- fatrat-1.2.0_beta2/src/remote/XmlRpcService.h 2012-07-14 12:44:27.000000000 +0100 -+++ fatrat-1.2.0_beta2.new/src/remote/XmlRpcService.h 2013-04-29 19:17:17.079967487 +0100 -@@ -34,7 +34,8 @@ respects for all of the code used other - #include <QVariantMap> - #include <QQueue> - #include <QPair> --#include <pion/net/WebServer.hpp> -+#include <pion/http/server.hpp> -+#include <pion/http/plugin_service.hpp> - - #ifndef WITH_WEBINTERFACE - # error This file is not supposed to be included! -@@ -43,12 +44,12 @@ respects for all of the code used other - class Queue; - class Transfer; - --class XmlRpcService : public QObject, public pion::net::WebService -+class XmlRpcService : public QObject, public pion::http::plugin_service - { - Q_OBJECT - public: - XmlRpcService(); -- void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); -+ void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); - static void globalInit(); - static void registerFunction(QString name, QVariant (*func)(QList<QVariant>&), QVector<QVariant::Type> arguments); - static void deregisterFunction(QString name); |