Skip to content
Closed
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
23 changes: 13 additions & 10 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ using socklen_t = int;
#ifdef __linux__
#include <resolv.h>
#endif
#include <csignal>
#include <netinet/tcp.h>
#include <poll.h>
#include <pthread.h>
Expand All @@ -267,6 +266,8 @@ using socklen_t = int;
#include <sys/un.h>
#include <unistd.h>

#include <csignal>

using socket_t = int;
#ifndef INVALID_SOCKET
#define INVALID_SOCKET (-1)
Expand All @@ -277,6 +278,10 @@ using socket_t = int;
#include <TargetConditionals.h>
#endif

#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>

#include <algorithm>
#include <array>
#include <atomic>
Expand All @@ -285,9 +290,7 @@ using socket_t = int;
#include <climits>
#include <condition_variable>
#include <cstring>
#include <errno.h>
#include <exception>
#include <fcntl.h>
#include <functional>
#include <iomanip>
#include <iostream>
Expand All @@ -300,7 +303,6 @@ using socket_t = int;
#include <set>
#include <sstream>
#include <string>
#include <sys/stat.h>
#include <thread>
#include <unordered_map>
#include <unordered_set>
Expand Down Expand Up @@ -5549,7 +5551,6 @@ class FormDataParser {

bool parse(const char *buf, size_t n, const FormDataHeader &header_callback,
const ContentReceiver &content_callback) {

buf_append(buf, n);

while (buf_size() > 0) {
Expand Down Expand Up @@ -7819,8 +7820,11 @@ inline bool Server::read_content_core(
multipart_receiver);
};
} else {
out = [receiver](const char *buf, size_t n, size_t /*off*/,
size_t /*len*/) { return receiver(buf, n); };
out = [receiver, &req](const char *buf, size_t n, size_t /*off*/,
size_t len) {
if (len > 0) { req.body.reserve(len); }
return receiver(buf, n);
};
}

if (req.method == "DELETE" && !req.has_header("Content-Length")) {
Expand Down Expand Up @@ -10745,7 +10749,6 @@ inline SSL_CTX *SSLServer::ssl_context() const { return ctx_; }

inline void SSLServer::update_certs(X509 *cert, EVP_PKEY *private_key,
X509_STORE *client_ca_cert_store) {

std::lock_guard<std::mutex> guard(ctx_mutex_);

SSL_CTX_use_certificate(ctx_, cert);
Expand Down Expand Up @@ -11809,8 +11812,8 @@ inline void Client::set_follow_location(bool on) {

inline void Client::set_path_encode(bool on) { cli_->set_path_encode(on); }

[[deprecated("Use set_path_encode instead")]]
inline void Client::set_url_encode(bool on) {
[[deprecated("Use set_path_encode instead")]] inline void
Client::set_url_encode(bool on) {
cli_->set_path_encode(on);
}

Expand Down
Loading