This commit is contained in:
yhirose 2021-05-22 19:24:50 -04:00
parent 2917b8a005
commit ba34ea4ee8

View file

@ -804,8 +804,7 @@ enum class Error {
Compression,
};
inline std::ostream& operator << (std::ostream& os, const Error& obj)
{
inline std::ostream &operator<<(std::ostream &os, const Error &obj) {
os << static_cast<std::underlying_type<Error>::type>(obj);
return os;
}
@ -3123,9 +3122,7 @@ write_content_chunked(Stream &strm, const ContentProvider &content_provider,
// Emit chunked response header and footer for each chunk
auto chunk =
from_i_to_hex(payload.size()) + "\r\n" + payload + "\r\n";
if (!write_data(strm, chunk.data(), chunk.size())) {
ok = false;
}
if (!write_data(strm, chunk.data(), chunk.size())) { ok = false; }
}
} else {
ok = false;
@ -6674,7 +6671,12 @@ inline ssize_t SSLSocketStream::read(char *ptr, size_t size) {
auto ret = SSL_read(ssl_, ptr, static_cast<int>(size));
if (ret < 0) {
auto err = SSL_get_error(ssl_, ret);
#ifdef _WIN32
while (err == SSL_ERROR_WANT_READ ||
err == SSL_ERROR_SYSCALL && WSAGetLastError() == WSAETIMEDOUT) {
#else
while (err == SSL_ERROR_WANT_READ) {
#endif
if (SSL_pending(ssl_) > 0) {
return SSL_read(ssl_, ptr, static_cast<int>(size));
} else if (is_readable()) {