mirror of https://gitee.com/bigwinds/arangodb
more refactoring
This commit is contained in:
parent
2d480a4350
commit
acdfbf8a20
|
@ -29,12 +29,12 @@
|
||||||
#define TRIAGENS_GENERAL_SERVER_GENERAL_SSL_SERVER_H 1
|
#define TRIAGENS_GENERAL_SERVER_GENERAL_SSL_SERVER_H 1
|
||||||
|
|
||||||
#include "GeneralServer/GeneralServer.h"
|
#include "GeneralServer/GeneralServer.h"
|
||||||
|
#include "GeneralServer/SslAsyncCommTask.h"
|
||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#include "Basics/ssl-helper.h"
|
#include "Basics/ssl-helper.h"
|
||||||
#include "Logger/Logger.h"
|
#include "Logger/Logger.h"
|
||||||
#include "HttpServer/SslAsyncCommTask.h"
|
|
||||||
#include "Scheduler/Scheduler.h"
|
#include "Scheduler/Scheduler.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -304,7 +304,7 @@ namespace triagens {
|
||||||
SSL_set_bio(ssl, sbio, sbio);
|
SSL_set_bio(ssl, sbio, sbio);
|
||||||
|
|
||||||
// create an ssl task
|
// create an ssl task
|
||||||
SocketTask* task = new SslAsyncCommTask<S, CT>(dynamic_cast<S*>(this), socket, info, sbio);
|
SocketTask* task = new SslAsyncCommTask<S, HF, CT>(dynamic_cast<S*>(this), socket, info, sbio);
|
||||||
|
|
||||||
// add the task, otherwise it will not be shut down properly
|
// add the task, otherwise it will not be shut down properly
|
||||||
GENERAL_SERVER_LOCK(&this->_commTasksLock);
|
GENERAL_SERVER_LOCK(&this->_commTasksLock);
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
/// @author Copyright 2010-2011, triAGENS GmbH, Cologne, Germany
|
/// @author Copyright 2010-2011, triAGENS GmbH, Cologne, Germany
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef TRIAGENS_FYN_HTTP_SERVER_SSL_ASYNC_COMM_TASK_H
|
#ifndef TRIAGENS_GENERAL_SERVER_SSL_ASYNC_COMM_TASK_H
|
||||||
#define TRIAGENS_FYN_HTTP_SERVER_SSL_ASYNC_COMM_TASK_H 1
|
#define TRIAGENS_GENERAL_SERVER_SSL_ASYNC_COMM_TASK_H 1
|
||||||
|
|
||||||
#include "GeneralServer/GeneralAsyncCommTask.h"
|
#include "GeneralServer/GeneralAsyncCommTask.h"
|
||||||
|
|
||||||
|
@ -39,10 +39,6 @@
|
||||||
#include <Logger/Logger.h>
|
#include <Logger/Logger.h>
|
||||||
#include <Basics/MutexLocker.h>
|
#include <Basics/MutexLocker.h>
|
||||||
#include <Basics/StringBuffer.h>
|
#include <Basics/StringBuffer.h>
|
||||||
#include <Rest/HttpRequest.h>
|
|
||||||
|
|
||||||
#include "HttpServer/HttpHandler.h"
|
|
||||||
#include "HttpServer/HttpHandlerFactory.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace triagens {
|
namespace triagens {
|
||||||
|
@ -52,8 +48,8 @@ namespace triagens {
|
||||||
/// @brief task for ssl communication
|
/// @brief task for ssl communication
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
template<typename S, typename CT>
|
template<typename S, typename HF, typename CT>
|
||||||
class SslAsyncCommTask : public GeneralAsyncCommTask<S, HttpHandlerFactory, CT> {
|
class SslAsyncCommTask : public GeneralAsyncCommTask<S, HF, CT> {
|
||||||
private:
|
private:
|
||||||
static size_t const READ_BLOCK_SIZE = 10000;
|
static size_t const READ_BLOCK_SIZE = 10000;
|
||||||
|
|
||||||
|
@ -68,7 +64,7 @@ namespace triagens {
|
||||||
ConnectionInfo const& info,
|
ConnectionInfo const& info,
|
||||||
BIO* bio)
|
BIO* bio)
|
||||||
: Task("SslAsyncCommTask"),
|
: Task("SslAsyncCommTask"),
|
||||||
GeneralAsyncCommTask<S, HttpHandlerFactory, CT>(server, fd, info),
|
GeneralAsyncCommTask<S, HF, CT>(server, fd, info),
|
||||||
accepted(false),
|
accepted(false),
|
||||||
readBlocked(false),
|
readBlocked(false),
|
||||||
readBlockedOnWrite(false),
|
readBlockedOnWrite(false),
|
||||||
|
@ -108,7 +104,7 @@ namespace triagens {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool handleEvent (EventToken token, EventType revents) {
|
bool handleEvent (EventToken token, EventType revents) {
|
||||||
bool result = GeneralAsyncCommTask<S, HttpHandlerFactory, CT>::handleEvent(token, revents);
|
bool result = GeneralAsyncCommTask<S, HF, CT>::handleEvent(token, revents);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
if (readBlockedOnWrite) {
|
if (readBlockedOnWrite) {
|
|
@ -29,16 +29,15 @@
|
||||||
#define TRIAGENS_HTTP_SERVER_HTTPS_SERVER_H 1
|
#define TRIAGENS_HTTP_SERVER_HTTPS_SERVER_H 1
|
||||||
|
|
||||||
#include "GeneralServer/GeneralSslServer.h"
|
#include "GeneralServer/GeneralSslServer.h"
|
||||||
#include "HttpServer/GeneralHttpServer.h"
|
|
||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#include "Basics/ssl-helper.h"
|
#include "Basics/ssl-helper.h"
|
||||||
#include "Logger/Logger.h"
|
#include "Logger/Logger.h"
|
||||||
|
|
||||||
|
#include "HttpServer/GeneralHttpServer.h"
|
||||||
#include "HttpServer/HttpCommTask.h"
|
#include "HttpServer/HttpCommTask.h"
|
||||||
#include "HttpServer/HttpHandler.h"
|
#include "HttpServer/HttpHandler.h"
|
||||||
#include "HttpServer/SslAsyncCommTask.h"
|
|
||||||
#include "Scheduler/Scheduler.h"
|
#include "Scheduler/Scheduler.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue