clang format a few files.

This commit is contained in:
Relintai 2021-07-06 22:20:38 +02:00
parent 5d07b6a233
commit 2b9e84b4be
3 changed files with 11 additions and 12 deletions

View File

@ -19,7 +19,7 @@ void DRequest::send() {
}
void DRequest::send_file(const std::string &p_file_path) {
HttpResponsePtr response = HttpResponse::newFileResponse(p_file_path ,"",drogon::getContentType(p_file_path));
HttpResponsePtr response = HttpResponse::newFileResponse(p_file_path, "", drogon::getContentType(p_file_path));
callback(response);
@ -55,7 +55,8 @@ void DRequest::pool() {
DRequest::pool(this);
}
DRequest::DRequest() : Request() {
DRequest::DRequest() :
Request() {
//This value will need benchmarks, 2 MB seems to be just as fast for me as 4 MB, but 1MB is slower
//It is a tradeoff on server memory though, as every active download will consume this amount of memory
@ -121,5 +122,4 @@ void DRequest::_file_chunk_sent() {
file_next = true;
}
RequestPool<DRequest> DRequest::_request_pool;

View File

@ -12,8 +12,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <trantor/utils/AsyncFileLogger.h>
#include <trantor/net/TcpConnection.h>
#include <trantor/utils/AsyncFileLogger.h>
#include <fcntl.h>
#include <sys/stat.h>
@ -536,16 +536,15 @@ void DWebApplication::on_async_request(const HttpRequestImplPtr &req, std::funct
//void HttpSimpleControllersRouter::route(const HttpRequestImplPtr &req,std::function<void(const HttpResponsePtr &)> &&callback)
//auto resp = HttpResponse::newHttpResponse();
//resp->setBody("<p>Hello, world!</p>");
//resp->setExpiredTime(0);
//callback(resp);
//resp->setBody("<p>Hello, world!</p>");
//resp->setExpiredTime(0);
//callback(resp);
DRequest *request = DRequest::get();
request->application = this;
request->request = std::shared_ptr<drogon::HttpRequestImpl>(req);
request->callback = callback;//std::move(callback);
request->callback = callback; //std::move(callback);
request->setup_url_stack();

View File

@ -37,9 +37,9 @@ public:
void migrate();
void add_listener(const std::string &ip, uint16_t port,
bool useSSL = false, const std::string &certFile = "", const std::string &keyFile = "", bool useOldTLS = false,
const std::vector<std::pair<std::string, std::string> > &sslConfCmds = {});
void add_listener(const std::string &ip, uint16_t port,
bool useSSL = false, const std::string &certFile = "", const std::string &keyFile = "", bool useOldTLS = false,
const std::vector<std::pair<std::string, std::string> > &sslConfCmds = {});
void set_thread_num(size_t thread_num);
size_t get_thread_num() const;