mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
http: Treat buffer full flush correctly.
Unix platforms may fail send with EAGAIN instead of 0 bytes.
This commit is contained in:
1 parent
fd1807b4b9
commit
c7becb2c75
1 file changed
+8
@@ -343,6 +343,10 @@ bool OutputSink::Flush(bool allowBlock) {
|
||||
size_t avail = std::min(BUFFER_SIZE - read_, valid_);
|
||||
|
||||
int bytes = send(fd_, buf_ + read_, (int)avail, MSG_NOSIGNAL);
|
||||
#if !PPSSPP_PLATFORM(WINDOWS)
|
||||
if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
|
||||
bytes = 0;
|
||||
#endif
|
||||
AccountDrain(bytes);
|
||||
|
||||
if (bytes == 0) {
|
||||
@@ -371,6 +375,10 @@ void OutputSink::Drain() {
|
||||
size_t avail = std::min(BUFFER_SIZE - read_, valid_);
|
||||
|
||||
int bytes = send(fd_, buf_ + read_, (int)avail, MSG_NOSIGNAL);
|
||||
#if !PPSSPP_PLATFORM(WINDOWS)
|
||||
if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
|
||||
bytes = 0;
|
||||
#endif
|
||||
AccountDrain(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user