@@ -894,7 +894,7 @@ class MatcherBase {
894
894
* Captures parameters in request path and stores them in Request::path_params
895
895
*
896
896
* Capture name is a substring of a pattern from : to /.
897
- * The rest of the pattern is matched agains the request path directly
897
+ * The rest of the pattern is matched against the request path directly
898
898
* Parameters are captured starting from the next character after
899
899
* the end of the last matched static pattern fragment until the next /.
900
900
*
@@ -1124,7 +1124,7 @@ class Server {
1124
1124
virtual bool process_and_close_socket (socket_t sock);
1125
1125
1126
1126
std::atomic<bool > is_running_{false };
1127
- std::atomic<bool > is_decommisioned {false };
1127
+ std::atomic<bool > is_decommissioned {false };
1128
1128
1129
1129
struct MountPointEntry {
1130
1130
std::string mount_point;
@@ -2586,7 +2586,7 @@ class stream_line_reader {
2586
2586
char *fixed_buffer_;
2587
2587
const size_t fixed_buffer_size_;
2588
2588
size_t fixed_buffer_used_size_ = 0 ;
2589
- std::string glowable_buffer_ ;
2589
+ std::string growable_buffer_ ;
2590
2590
};
2591
2591
2592
2592
class mmap {
@@ -3022,18 +3022,18 @@ inline stream_line_reader::stream_line_reader(Stream &strm, char *fixed_buffer,
3022
3022
fixed_buffer_size_(fixed_buffer_size) {}
3023
3023
3024
3024
inline const char *stream_line_reader::ptr () const {
3025
- if (glowable_buffer_ .empty ()) {
3025
+ if (growable_buffer_ .empty ()) {
3026
3026
return fixed_buffer_;
3027
3027
} else {
3028
- return glowable_buffer_ .data ();
3028
+ return growable_buffer_ .data ();
3029
3029
}
3030
3030
}
3031
3031
3032
3032
inline size_t stream_line_reader::size () const {
3033
- if (glowable_buffer_ .empty ()) {
3033
+ if (growable_buffer_ .empty ()) {
3034
3034
return fixed_buffer_used_size_;
3035
3035
} else {
3036
- return glowable_buffer_ .size ();
3036
+ return growable_buffer_ .size ();
3037
3037
}
3038
3038
}
3039
3039
@@ -3044,7 +3044,7 @@ inline bool stream_line_reader::end_with_crlf() const {
3044
3044
3045
3045
inline bool stream_line_reader::getline () {
3046
3046
fixed_buffer_used_size_ = 0 ;
3047
- glowable_buffer_ .clear ();
3047
+ growable_buffer_ .clear ();
3048
3048
3049
3049
#ifndef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
3050
3050
char prev_byte = 0 ;
@@ -3082,11 +3082,11 @@ inline void stream_line_reader::append(char c) {
3082
3082
fixed_buffer_[fixed_buffer_used_size_++] = c;
3083
3083
fixed_buffer_[fixed_buffer_used_size_] = ' \0 ' ;
3084
3084
} else {
3085
- if (glowable_buffer_ .empty ()) {
3085
+ if (growable_buffer_ .empty ()) {
3086
3086
assert (fixed_buffer_[fixed_buffer_used_size_] == ' \0 ' );
3087
- glowable_buffer_ .assign (fixed_buffer_, fixed_buffer_used_size_);
3087
+ growable_buffer_ .assign (fixed_buffer_, fixed_buffer_used_size_);
3088
3088
}
3089
- glowable_buffer_ += c;
3089
+ growable_buffer_ += c;
3090
3090
}
3091
3091
}
3092
3092
@@ -4259,10 +4259,6 @@ inline bool parse_header(const char *beg, const char *end, T fn) {
4259
4259
if (!key_len) { return false ; }
4260
4260
4261
4261
auto key = std::string (beg, key_end);
4262
- // auto val = (case_ignore::equal(key, "Location") ||
4263
- // case_ignore::equal(key, "Referer"))
4264
- // ? std::string(p, end)
4265
- // : decode_url(std::string(p, end), false);
4266
4262
auto val = std::string (p, end);
4267
4263
4268
4264
if (!detail::fields::is_field_value (val)) { return false ; }
@@ -4401,7 +4397,7 @@ inline bool read_content_chunked(Stream &strm, T &x,
4401
4397
4402
4398
assert (chunk_len == 0 );
4403
4399
4404
- // NOTE: In RFC 9112, '7.1 Chunked Transfer Coding' mentiones "The chunked
4400
+ // NOTE: In RFC 9112, '7.1 Chunked Transfer Coding' mentions "The chunked
4405
4401
// transfer coding is complete when a chunk with a chunk-size of zero is
4406
4402
// received, possibly followed by a trailer section, and finally terminated by
4407
4403
// an empty line". https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1
@@ -4411,8 +4407,8 @@ inline bool read_content_chunked(Stream &strm, T &x,
4411
4407
// to be ok whether the final CRLF exists or not in the chunked data.
4412
4408
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1.3
4413
4409
//
4414
- // According to the reference code in RFC 9112, cpp-htpplib now allows
4415
- // chuncked transfer coding data without the final CRLF.
4410
+ // According to the reference code in RFC 9112, cpp-httplib now allows
4411
+ // chunked transfer coding data without the final CRLF.
4416
4412
if (!line_reader.getline ()) { return true ; }
4417
4413
4418
4414
while (strcmp (line_reader.ptr (), " \r\n " ) != 0 ) {
@@ -5002,7 +4998,7 @@ class MultipartFormDataParser {
5002
4998
5003
4999
it = params.find (" filename*" );
5004
5000
if (it != params.end ()) {
5005
- // Only allow UTF-8 enconnding ...
5001
+ // Only allow UTF-8 encoding ...
5006
5002
static const std::regex re_rfc5987_encoding (
5007
5003
R"~( ^UTF-8''(.+?)$)~" , std::regex_constants::icase);
5008
5004
@@ -5249,7 +5245,7 @@ serialize_multipart_formdata(const MultipartFormDataItems &items,
5249
5245
5250
5246
inline bool range_error (Request &req, Response &res) {
5251
5247
if (!req.ranges .empty () && 200 <= res.status && res.status < 300 ) {
5252
- ssize_t contant_len = static_cast <ssize_t >(
5248
+ ssize_t content_len = static_cast <ssize_t >(
5253
5249
res.content_length_ ? res.content_length_ : res.body .size ());
5254
5250
5255
5251
ssize_t prev_first_pos = -1 ;
@@ -5269,12 +5265,12 @@ inline bool range_error(Request &req, Response &res) {
5269
5265
5270
5266
if (first_pos == -1 && last_pos == -1 ) {
5271
5267
first_pos = 0 ;
5272
- last_pos = contant_len ;
5268
+ last_pos = content_len ;
5273
5269
}
5274
5270
5275
5271
if (first_pos == -1 ) {
5276
- first_pos = contant_len - last_pos;
5277
- last_pos = contant_len - 1 ;
5272
+ first_pos = content_len - last_pos;
5273
+ last_pos = content_len - 1 ;
5278
5274
}
5279
5275
5280
5276
// NOTE: RFC-9110 '14.1.2. Byte Ranges':
@@ -5286,13 +5282,13 @@ inline bool range_error(Request &req, Response &res) {
5286
5282
// with a value that is one less than the current length of the selected
5287
5283
// representation).
5288
5284
// https://www.rfc-editor.org/rfc/rfc9110.html#section-14.1.2-6
5289
- if (last_pos == -1 || last_pos >= contant_len ) {
5290
- last_pos = contant_len - 1 ;
5285
+ if (last_pos == -1 || last_pos >= content_len ) {
5286
+ last_pos = content_len - 1 ;
5291
5287
}
5292
5288
5293
5289
// Range must be within content length
5294
5290
if (!(0 <= first_pos && first_pos <= last_pos &&
5295
- last_pos <= contant_len - 1 )) {
5291
+ last_pos <= content_len - 1 )) {
5296
5292
return true ;
5297
5293
}
5298
5294
@@ -6486,12 +6482,12 @@ inline Server &Server::set_payload_max_length(size_t length) {
6486
6482
inline bool Server::bind_to_port (const std::string &host, int port,
6487
6483
int socket_flags) {
6488
6484
auto ret = bind_internal (host, port, socket_flags);
6489
- if (ret == -1 ) { is_decommisioned = true ; }
6485
+ if (ret == -1 ) { is_decommissioned = true ; }
6490
6486
return ret >= 0 ;
6491
6487
}
6492
6488
inline int Server::bind_to_any_port (const std::string &host, int socket_flags) {
6493
6489
auto ret = bind_internal (host, 0 , socket_flags);
6494
- if (ret == -1 ) { is_decommisioned = true ; }
6490
+ if (ret == -1 ) { is_decommissioned = true ; }
6495
6491
return ret;
6496
6492
}
6497
6493
@@ -6505,7 +6501,7 @@ inline bool Server::listen(const std::string &host, int port,
6505
6501
inline bool Server::is_running () const { return is_running_; }
6506
6502
6507
6503
inline void Server::wait_until_ready () const {
6508
- while (!is_running_ && !is_decommisioned ) {
6504
+ while (!is_running_ && !is_decommissioned ) {
6509
6505
std::this_thread::sleep_for (std::chrono::milliseconds{1 });
6510
6506
}
6511
6507
}
@@ -6517,10 +6513,10 @@ inline void Server::stop() {
6517
6513
detail::shutdown_socket (sock);
6518
6514
detail::close_socket (sock);
6519
6515
}
6520
- is_decommisioned = false ;
6516
+ is_decommissioned = false ;
6521
6517
}
6522
6518
6523
- inline void Server::decommission () { is_decommisioned = true ; }
6519
+ inline void Server::decommission () { is_decommissioned = true ; }
6524
6520
6525
6521
inline bool Server::parse_request_line (const char *s, Request &req) const {
6526
6522
auto len = strlen (s);
@@ -6879,7 +6875,7 @@ Server::create_server_socket(const std::string &host, int port,
6879
6875
6880
6876
inline int Server::bind_internal (const std::string &host, int port,
6881
6877
int socket_flags) {
6882
- if (is_decommisioned ) { return -1 ; }
6878
+ if (is_decommissioned ) { return -1 ; }
6883
6879
6884
6880
if (!is_valid ()) { return -1 ; }
6885
6881
@@ -6906,7 +6902,7 @@ inline int Server::bind_internal(const std::string &host, int port,
6906
6902
}
6907
6903
6908
6904
inline bool Server::listen_internal () {
6909
- if (is_decommisioned ) { return false ; }
6905
+ if (is_decommissioned ) { return false ; }
6910
6906
6911
6907
auto ret = true ;
6912
6908
is_running_ = true ;
@@ -6930,7 +6926,7 @@ inline bool Server::listen_internal() {
6930
6926
#endif
6931
6927
6932
6928
#if defined _WIN32
6933
- // sockets conneced via WASAccept inherit flags NO_HANDLE_INHERIT,
6929
+ // sockets connected via WASAccept inherit flags NO_HANDLE_INHERIT,
6934
6930
// OVERLAPPED
6935
6931
socket_t sock = WSAAccept (svr_sock_, nullptr , nullptr , nullptr , 0 );
6936
6932
#elif defined SOCK_CLOEXEC
@@ -6972,7 +6968,7 @@ inline bool Server::listen_internal() {
6972
6968
task_queue->shutdown ();
6973
6969
}
6974
6970
6975
- is_decommisioned = !ret;
6971
+ is_decommissioned = !ret;
6976
6972
return ret;
6977
6973
}
6978
6974
@@ -7594,7 +7590,7 @@ inline bool ClientImpl::send_(Request &req, Response &res, Error &error) {
7594
7590
#endif
7595
7591
7596
7592
if (!is_alive) {
7597
- // Attempt to avoid sigpipe by shutting down nongracefully if it seems
7593
+ // Attempt to avoid sigpipe by shutting down non-gracefully if it seems
7598
7594
// like the other side has already closed the connection Also, there
7599
7595
// cannot be any requests in flight from other threads since we locked
7600
7596
// request_mutex_, so safe to close everything immediately
0 commit comments