@@ -804,10 +804,9 @@ enum class Error {
804804 Compression,
805805};
806806
807- inline std::ostream& operator << (std::ostream& os, const Error& obj)
808- {
809- os << static_cast <std::underlying_type<Error>::type>(obj);
810- return os;
807+ inline std::ostream &operator <<(std::ostream &os, const Error &obj) {
808+ os << static_cast <std::underlying_type<Error>::type>(obj);
809+ return os;
811810}
812811
813812class Result {
@@ -1625,7 +1624,7 @@ inline std::string encode_query_param(const std::string &value) {
16251624inline std::string encode_url (const std::string &s) {
16261625 std::string result;
16271626 result.reserve (s.size ());
1628-
1627+
16291628 for (size_t i = 0 ; s[i]; i++) {
16301629 switch (s[i]) {
16311630 case ' ' : result += " %20" ; break ;
@@ -3123,9 +3122,7 @@ write_content_chunked(Stream &strm, const ContentProvider &content_provider,
31233122 // Emit chunked response header and footer for each chunk
31243123 auto chunk =
31253124 from_i_to_hex (payload.size ()) + " \r\n " + payload + " \r\n " ;
3126- if (!write_data (strm, chunk.data (), chunk.size ())) {
3127- ok = false ;
3128- }
3125+ if (!write_data (strm, chunk.data (), chunk.size ())) { ok = false ; }
31293126 }
31303127 } else {
31313128 ok = false ;
@@ -6674,7 +6671,12 @@ inline ssize_t SSLSocketStream::read(char *ptr, size_t size) {
66746671 auto ret = SSL_read (ssl_, ptr, static_cast <int >(size));
66756672 if (ret < 0 ) {
66766673 auto err = SSL_get_error (ssl_, ret);
6674+ #ifdef _WIN32
6675+ while (err == SSL_ERROR_WANT_READ ||
6676+ err == SSL_ERROR_SYSCALL && WSAGetLastError () == WSAETIMEDOUT) {
6677+ #else
66776678 while (err == SSL_ERROR_WANT_READ) {
6679+ #endif
66786680 if (SSL_pending (ssl_) > 0 ) {
66796681 return SSL_read (ssl_, ptr, static_cast <int >(size));
66806682 } else if (is_readable ()) {
0 commit comments