Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
3531-kernel-esock-Check-if-actually-done-when-r...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3531-kernel-esock-Check-if-actually-done-when-recv.patch of Package erlang
From 5feb983794115ee90ec1f9d4acd988823148d7a4 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Sat, 7 Sep 2024 09:11:55 +0200 Subject: [PATCH] [kernel|esock] Check if actually done when recv Make sure that we have actually received all data before we return. This is a Windows only issue. OTP-19328 --- lib/kernel/src/socket.erl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/kernel/src/socket.erl b/lib/kernel/src/socket.erl index aea6690f45..e0ce0a1667 100644 --- a/lib/kernel/src/socket.erl +++ b/lib/kernel/src/socket.erl @@ -5169,9 +5169,26 @@ recv_deadline(SockRef, Length, Flags, Deadline, Buf) -> _ = cancel(SockRef, recv, Handle), recv_error(Buf, timeout) end; - %% - {ok, Bin} -> % All requested data + + + %% All requested data + {ok, Bin} when (Length =:= 0) orelse + (Length =:= byte_size(Bin)) -> % All requested data {ok, condense_buffer([Bin | Buf])}; + + {ok, Bin} -> % Only part of the requested data + Timeout = timeout(Deadline), + if + 0 < Timeout -> + %% Recv more + recv_deadline( + SockRef, Length - byte_size(Bin), Flags, + Deadline, [Bin | Buf]); + true -> + recv_error([Bin | Buf], timeout) + end; + + %% {error, Reason} -> recv_error(Buf, Reason) -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor