Merge issue-38-targets: Windows select backend foundation and Alpine/musl test qualification
This commit is contained in:
commit
0002e74a7d
4 files changed
+895
-18
No files matched your search
@@ -87,14 +87,16 @@ namespace
|
||||
|
||||
std::string recv_until(int fd, std::string_view marker)
|
||||
{
|
||||
// Read one byte at a time: the caller reads the body right after the
|
||||
// header, so consuming bytes past the marker would lose body data.
|
||||
std::string out;
|
||||
std::array<char, 1024> buf{};
|
||||
char c = 0;
|
||||
while (out.find(marker) == std::string::npos) {
|
||||
const ssize_t n = ::recv(fd, buf.data(), buf.size(), 0);
|
||||
const ssize_t n = ::recv(fd, &c, 1, 0);
|
||||
if (n <= 0) {
|
||||
break;
|
||||
}
|
||||
out.append(buf.data(), static_cast<std::size_t>(n));
|
||||
out.push_back(c);
|
||||
if (out.size() > 64 * 1024) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user