Skip to content

Commit ebad8e4

Browse files
committed
Fix CSF.
1 parent e904c33 commit ebad8e4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

httplib.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ using ssize_t = __int64;
209209
#endif // _MSC_VER
210210

211211
#ifndef S_ISREG
212-
#define S_ISREG(m) (((m)&S_IFREG) == S_IFREG)
212+
#define S_ISREG(m) (((m) & S_IFREG) == S_IFREG)
213213
#endif // S_ISREG
214214

215215
#ifndef S_ISDIR
216-
#define S_ISDIR(m) (((m)&S_IFDIR) == S_IFDIR)
216+
#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
217217
#endif // S_ISDIR
218218

219219
#ifndef NOMINMAX
@@ -258,7 +258,6 @@ using socklen_t = int;
258258
#ifdef __linux__
259259
#include <resolv.h>
260260
#endif
261-
#include <csignal>
262261
#include <netinet/tcp.h>
263262
#include <poll.h>
264263
#include <pthread.h>
@@ -267,6 +266,8 @@ using socklen_t = int;
267266
#include <sys/un.h>
268267
#include <unistd.h>
269268

269+
#include <csignal>
270+
270271
using socket_t = int;
271272
#ifndef INVALID_SOCKET
272273
#define INVALID_SOCKET (-1)
@@ -277,6 +278,10 @@ using socket_t = int;
277278
#include <TargetConditionals.h>
278279
#endif
279280

281+
#include <errno.h>
282+
#include <fcntl.h>
283+
#include <sys/stat.h>
284+
280285
#include <algorithm>
281286
#include <array>
282287
#include <atomic>
@@ -285,9 +290,7 @@ using socket_t = int;
285290
#include <climits>
286291
#include <condition_variable>
287292
#include <cstring>
288-
#include <errno.h>
289293
#include <exception>
290-
#include <fcntl.h>
291294
#include <functional>
292295
#include <iomanip>
293296
#include <iostream>
@@ -300,7 +303,6 @@ using socket_t = int;
300303
#include <set>
301304
#include <sstream>
302305
#include <string>
303-
#include <sys/stat.h>
304306
#include <thread>
305307
#include <unordered_map>
306308
#include <unordered_set>
@@ -5549,7 +5551,6 @@ class FormDataParser {
55495551

55505552
bool parse(const char *buf, size_t n, const FormDataHeader &header_callback,
55515553
const ContentReceiver &content_callback) {
5552-
55535554
buf_append(buf, n);
55545555

55555556
while (buf_size() > 0) {
@@ -7821,7 +7822,7 @@ inline bool Server::read_content_core(
78217822
} else {
78227823
out = [receiver, &req](const char *buf, size_t n, size_t /*off*/,
78237824
size_t len) {
7824-
if (len > req.body.size()) { req.body.resize(len); }
7825+
if (len > 0) { req.body.reserve(len); }
78257826
return receiver(buf, n);
78267827
};
78277828
}
@@ -10748,7 +10749,6 @@ inline SSL_CTX *SSLServer::ssl_context() const { return ctx_; }
1074810749

1074910750
inline void SSLServer::update_certs(X509 *cert, EVP_PKEY *private_key,
1075010751
X509_STORE *client_ca_cert_store) {
10751-
1075210752
std::lock_guard<std::mutex> guard(ctx_mutex_);
1075310753

1075410754
SSL_CTX_use_certificate(ctx_, cert);

0 commit comments

Comments
 (0)