diff options
| author | Fabio Alessandrelli | 2017-01-16 15:25:16 +0100 |
|---|---|---|
| committer | Fabio Alessandrelli | 2017-01-16 15:51:43 +0100 |
| commit | 8322c1aa644e2edf778b6b8fe404043dd673cef1 (patch) | |
| tree | e9751f8c45b90d9c2e8a6bd116418f1fab51edce /platform/windows/stream_peer_winsock.cpp | |
| parent | 6b5a852bd843dbcf69ff261fea69ca6557923393 (diff) | |
| download | godot-8322c1aa644e2edf778b6b8fe404043dd673cef1.tar.gz godot-8322c1aa644e2edf778b6b8fe404043dd673cef1.tar.zst godot-8322c1aa644e2edf778b6b8fe404043dd673cef1.zip | |
Fix bug in windows TCP poll function
Bug introduced when implementing TCP disconnection detection.
(too much yank-paste).
Fixes #7545
(cherry picked from commit c356ec5e8bf1ecaa5acedc204d613c4d1c2db3db)
Diffstat (limited to '')
| -rw-r--r-- | platform/windows/stream_peer_winsock.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index a48a02c7a..c58b3f811 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -98,7 +98,7 @@ Error StreamPeerWinsock::_poll_connection(bool p_block) const { return OK; }; - if (errno == WSAEINPROGRESS || errno == WSAEALREADY) { + if (err == WSAEINPROGRESS || err == WSAEALREADY) { return OK; } @@ -136,13 +136,11 @@ Error StreamPeerWinsock::write(const uint8_t* p_data,int p_bytes, int &r_sent, b int data_to_send = p_bytes; const uint8_t *offset = p_data; if (sockfd == -1) return FAILED; - errno = 0; int total_sent = 0; while (data_to_send) { int sent_amount = send(sockfd, (const char*)offset, data_to_send, 0); - //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); if (sent_amount == -1) { @@ -195,7 +193,6 @@ Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bo int to_read = p_bytes; int total_read = 0; - errno = 0; while (to_read) { |
