diff --git a/Jupiter/HTTP_Server.cpp b/Jupiter/HTTP_Server.cpp index ca99e8a..911350d 100644 --- a/Jupiter/HTTP_Server.cpp +++ b/Jupiter/HTTP_Server.cpp @@ -144,6 +144,7 @@ bool Jupiter::HTTP::Server::Directory::remove(const Jupiter::ReadableString &pat if (in_name_ref.isEmpty()) // Remove content { Jupiter::HTTP::Server::Content *content_node; + checksum = content_name.calcChecksum(); index = Jupiter::HTTP::Server::Directory::content.size(); while (index != 0) { @@ -797,7 +798,8 @@ int Jupiter::HTTP::Server::think() } else if ((std::chrono::steady_clock::now() > session->last_active + Jupiter::HTTP::Server::data_->keep_alive_session_timeout) || (session->keep_alive == false && std::chrono::steady_clock::now() > session->last_active + Jupiter::HTTP::Server::data_->session_timeout)) - session->sock.shutdown(); + delete Jupiter::HTTP::Server::data_->sessions.remove(index); + //session->sock.shutdown(); else if (session->sock.recv() > 0) { const Jupiter::ReadableString &sock_buffer = session->sock.getBuffer(); @@ -809,7 +811,8 @@ int Jupiter::HTTP::Server::think() session->last_active = std::chrono::steady_clock::now(); Jupiter::HTTP::Server::data_->process_request(*session); if (session->keep_alive == false) // remove completed session - session->sock.shutdown(); + delete Jupiter::HTTP::Server::data_->sessions.remove(index); + //session->sock.shutdown(); } else if (session->request.size() == Jupiter::HTTP::Server::data_->max_request_size) // reject (full buffer) delete Jupiter::HTTP::Server::data_->sessions.remove(index); @@ -831,6 +834,7 @@ int Jupiter::HTTP::Server::think() { socket->setBlocking(false); session = new HTTPSession(std::move(*socket)); + printf("Incoming session; %u other sessions already stored." ENDL, this->data_->sessions.size()); if (session->sock.recv() > 0) // data received { const Jupiter::ReadableString &sock_buffer = session->sock.getBuffer(); diff --git a/Jupiter/Readable_String.h b/Jupiter/Readable_String.h index 3db431f..ab02046 100644 --- a/Jupiter/Readable_String.h +++ b/Jupiter/Readable_String.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2014-2015 Jessica James. + * Copyright (C) 2014-2016 Jessica James. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/Jupiter/SecureSocket.h b/Jupiter/SecureSocket.h index 1d63491..21f32f9 100644 --- a/Jupiter/SecureSocket.h +++ b/Jupiter/SecureSocket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2015 Jessica James. + * Copyright (C) 2013-2016 Jessica James. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -168,7 +168,7 @@ namespace Jupiter /** * @brief Default constructor for the SecureSocket class. - * This constructor will set the buffer size to 4096 chars. + * This constructor will set the buffer size to 512 chars. */ SecureSocket(); diff --git a/Jupiter/Socket.cpp b/Jupiter/Socket.cpp index 395a085..7a25404 100644 --- a/Jupiter/Socket.cpp +++ b/Jupiter/Socket.cpp @@ -96,7 +96,7 @@ Jupiter::Socket &Jupiter::Socket::operator=(Jupiter::Socket &&source) return *this; } -Jupiter::Socket::Socket() : Jupiter::Socket::Socket(4096) +Jupiter::Socket::Socket() : Jupiter::Socket::Socket(512) { } @@ -116,9 +116,7 @@ Jupiter::Socket::~Socket() if (Jupiter::Socket::data_ != nullptr) { if (Jupiter::Socket::data_->rawSock > 0) - { Jupiter::Socket::close(); - } delete Jupiter::Socket::data_; } } diff --git a/Jupiter/Socket.h b/Jupiter/Socket.h index 29fda66..b83faa8 100644 --- a/Jupiter/Socket.h +++ b/Jupiter/Socket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2015 Jessica James. + * Copyright (C) 2013-2016 Jessica James. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -492,7 +492,7 @@ namespace Jupiter /** * @brief Default constructor for the Socket class. - * This constructor will set the buffer size to 4096 chars. + * This constructor will set the buffer size to 512 chars. */ Socket(); diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index dcb3a40..fdf29bf 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ