We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d242cc8 commit bfd5a07Copy full SHA for bfd5a07
clickhouse/base/socket.cpp
@@ -457,11 +457,12 @@ size_t SocketOutput::DoWrite(const void* data, size_t len) {
457
static const int flags = 0;
458
#endif
459
460
- if (::send(s_, (const char*)data, (int)len, flags) != (int)len) {
+ const ssize_t ret = ::send(s_, (const char*)data, (int)len, flags);
461
+ if (ret < 0) {
462
throw std::system_error(getSocketErrorCode(), getErrorCategory(), "fail to send " + std::to_string(len) + " bytes of data");
463
}
464
- return len;
465
+ return (size_t)ret;
466
467
468
0 commit comments