Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/benchmark_nodelay.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <httpserver.hpp>
#include <cstdlib>
#include <memory>

#include <httpserver.hpp>

#define PATH "/plaintext"
#define BODY "Hello, World!"

Expand Down
3 changes: 2 additions & 1 deletion examples/benchmark_select.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <httpserver.hpp>
#include <cstdlib>
#include <memory>

#include <httpserver.hpp>

#define PATH "/plaintext"
#define BODY "Hello, World!"

Expand Down
3 changes: 2 additions & 1 deletion examples/benchmark_threads.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <httpserver.hpp>
#include <cstdlib>
#include <memory>

#include <httpserver.hpp>

#define PATH "/plaintext"
#define BODY "Hello, World!"

Expand Down
3 changes: 2 additions & 1 deletion examples/custom_access_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
USA
*/

#include <httpserver.hpp>
#include <iostream>

#include <httpserver.hpp>

using namespace httpserver;

void custom_access_log(const std::string& url) {
Expand Down
3 changes: 2 additions & 1 deletion examples/deferred_with_accumulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
USA
*/

#include <atomic>
#include <chrono>
#include <thread>
#include <atomic>

#include <httpserver.hpp>

using namespace httpserver;
Expand Down
3 changes: 2 additions & 1 deletion examples/hello_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
USA
*/

#include <httpserver.hpp>
#include <iostream>

#include <httpserver.hpp>

using namespace httpserver;

class hello_world_resource : public http_resource {
Expand Down
6 changes: 4 additions & 2 deletions examples/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
USA
*/

#include <httpserver.hpp>
#include <iostream>
#include <unistd.h>

#include <cstdio>
#include <iostream>

#include <httpserver.hpp>

using namespace httpserver;

Expand Down
1 change: 1 addition & 0 deletions src/details/http_endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include "httpserver/details/http_endpoint.hpp"

#include "httpserver/http_utils.hpp"
#include "httpserver/string_utilities.hpp"

Expand Down
3 changes: 2 additions & 1 deletion src/file_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
USA
*/

#include <fcntl.h>
#include "httpserver/file_response.hpp"

#include <fcntl.h>

using namespace std;

namespace httpserver
Expand Down
6 changes: 4 additions & 2 deletions src/http_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

*/

#include "httpserver/http_utils.hpp"
#include "httpserver/http_request.hpp"
#include "httpserver/string_utilities.hpp"

#include <iostream>

#include "httpserver/http_utils.hpp"
#include "httpserver/string_utilities.hpp"

using namespace std;

namespace httpserver
Expand Down
9 changes: 5 additions & 4 deletions src/http_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@

*/

#include "httpserver/http_resource.hpp"

#include <stdlib.h>

#include "httpserver/http_resource.hpp"
#include "httpserver/http_utils.hpp"
#include "httpserver/http_request.hpp"
#include "httpserver/http_response.hpp"
#include "httpserver/webserver.hpp"
#include "httpserver/string_utilities.hpp"
#include "httpserver/http_utils.hpp"
#include "httpserver/string_response.hpp"
#include "httpserver/string_utilities.hpp"
#include "httpserver/webserver.hpp"

using namespace std;

Expand Down
8 changes: 5 additions & 3 deletions src/http_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
USA
*/

#include "httpserver/http_response.hpp"

#include <fcntl.h>
#include <unistd.h>
#include <cstdio>
#include <functional>
#include <iostream>
#include <sstream>
#include <fcntl.h>
#include <unistd.h>

#include "httpserver/http_utils.hpp"
#include "httpserver/webserver.hpp"
#include "httpserver/http_response.hpp"

using namespace std;

Expand Down
15 changes: 9 additions & 6 deletions src/http_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
USA
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "httpserver/http_utils.hpp"

#if defined(__MINGW32__) || defined(__CYGWIN32__)
#define _WINDOWS
#undef _WIN32_WINNT
Expand All @@ -32,13 +31,17 @@
#include <netdb.h>
#include <arpa/inet.h>
#endif
#include <sstream>
#include <iomanip>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>

#include "httpserver/string_utilities.hpp"
#include "httpserver/http_utils.hpp"

#pragma GCC diagnostic ignored "-Warray-bounds"
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
Expand Down
12 changes: 5 additions & 7 deletions src/httpserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@

#define _HTTPSERVER_HPP_INSIDE_

#include "httpserver/http_utils.hpp"
#include "httpserver/http_resource.hpp"
#include "httpserver/http_response.hpp"

#include "httpserver/string_response.hpp"
#include "httpserver/basic_auth_fail_response.hpp"
#include "httpserver/digest_auth_fail_response.hpp"
#include "httpserver/deferred_response.hpp"
#include "httpserver/digest_auth_fail_response.hpp"
#include "httpserver/file_response.hpp"

#include "httpserver/http_request.hpp"
#include "httpserver/http_resource.hpp"
#include "httpserver/http_response.hpp"
#include "httpserver/http_utils.hpp"
#include "httpserver/string_response.hpp"
#include "httpserver/webserver.hpp"

#endif
3 changes: 2 additions & 1 deletion src/httpserver/create_webserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#define _CREATE_WEBSERVER_HPP_

#include <stdlib.h>
#include "httpserver/http_utils.hpp"

#include "httpserver/http_response.hpp"
#include "httpserver/http_utils.hpp"

#define DEFAULT_WS_TIMEOUT 180
#define DEFAULT_WS_PORT 9898
Expand Down
1 change: 1 addition & 0 deletions src/httpserver/deferred_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define _DEFERRED_RESPONSE_HPP_

#include <memory>

#include "httpserver/string_response.hpp"

namespace httpserver
Expand Down
6 changes: 3 additions & 3 deletions src/httpserver/details/http_endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#ifndef _HTTP_ENDPOINT_HPP_
#define _HTTP_ENDPOINT_HPP_

#include <vector>
#include <utility>
#include <regex.h>
#include <string>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

namespace httpserver
{
Expand Down
2 changes: 2 additions & 0 deletions src/httpserver/details/modded_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifndef _MODDED_REQUEST_HPP_
#define _MODDED_REQUEST_HPP_

#include "httpserver/http_request.hpp"

namespace httpserver
{

Expand Down
6 changes: 4 additions & 2 deletions src/httpserver/http_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
#ifndef _HTTP_REQUEST_HPP_
#define _HTTP_REQUEST_HPP_

#include <iosfwd>
#include <map>
#include <vector>
#include <string>
#include <utility>
#include <iosfwd>
#include <vector>

#include "httpserver/http_utils.hpp"

struct MHD_Connection;

Expand Down
6 changes: 3 additions & 3 deletions src/httpserver/http_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

#ifndef _http_resource_hpp_
#define _http_resource_hpp_
#include <map>
#include <string>
#include <memory>

#ifdef DEBUG
#include <iostream>
#endif
#include <map>
#include <memory>
#include <string>

#include "httpserver/http_response.hpp"

Expand Down
7 changes: 4 additions & 3 deletions src/httpserver/http_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

#ifndef _HTTP_RESPONSE_HPP_
#define _HTTP_RESPONSE_HPP_
#include <map>
#include <utility>
#include <string>

#include <iosfwd>
#include <map>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>

#include "httpserver/http_utils.hpp"
Expand Down
14 changes: 7 additions & 7 deletions src/httpserver/http_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
#ifndef _HTTPUTILS_H_
#define _HTTPUTILS_H_

#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include <microhttpd.h>
#include <string>
#include <cctype>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <exception>
#include <iosfwd>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include <map>
#include <string>
#include <vector>

#define DEFAULT_MASK_VALUE 0xFFFF

Expand Down
16 changes: 7 additions & 9 deletions src/httpserver/webserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,21 @@
#define NOT_METHOD_ERROR "Method not Acceptable"
#define GENERIC_ERROR "Internal Error"

#include <pthread.h>
#include <stdlib.h>
#include <cstring>
#include <deque>
#include <map>
#include <vector>
#include <memory>
#include <set>
#include <stdexcept>
#include <string>
#include <utility>
#include <stdlib.h>
#include <memory>
#include <deque>

#include <pthread.h>
#include <stdexcept>
#include <vector>

#include "httpserver/create_webserver.hpp"
#include "httpserver/http_response.hpp"

#include "httpserver/details/http_endpoint.hpp"
#include "httpserver/http_response.hpp"

namespace httpserver {

Expand Down
13 changes: 7 additions & 6 deletions src/string_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
USA
*/

#include "httpserver/string_utilities.hpp"

#include <regex.h>
#include <algorithm>
#include <string>
#include <istream>
#include <sstream>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <regex.h>
#include "httpserver/string_utilities.hpp"
#include <istream>
#include <sstream>
#include <string>
#include <vector>

namespace httpserver
{
Expand Down
Loading