mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-22 16:09:23 +00:00
Tests/LibCore: Enable TestLibCoreStream in Windows CI
This commit is contained in:
parent
e01a95f6cd
commit
688d0ada97
Notes:
github-actions[bot]
2025-08-07 02:25:42 +00:00
Author: https://github.com/ayeteadoe
Commit: 688d0ada97
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5435
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
5 changed files with 89 additions and 38 deletions
|
@ -292,6 +292,21 @@ ErrorOr<NonnullOwnPtr<UDPSocket>> UDPSocket::connect(SocketAddress const& addres
|
|||
return socket;
|
||||
}
|
||||
|
||||
ErrorOr<Bytes> UDPSocket::read_some(Bytes buffer)
|
||||
{
|
||||
auto pending_bytes = TRY(this->pending_bytes());
|
||||
if (pending_bytes > buffer.size()) {
|
||||
// With UDP datagrams, reading a datagram into a buffer that's
|
||||
// smaller than the datagram's size will cause the rest of the
|
||||
// datagram to be discarded. That's not very nice, so let's bail
|
||||
// early, telling the caller that he should allocate a bigger
|
||||
// buffer.
|
||||
return Error::from_errno(EMSGSIZE);
|
||||
}
|
||||
|
||||
return m_helper.read(buffer, default_flags());
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<LocalSocket>> LocalSocket::connect(ByteString const& path, PreventSIGPIPE prevent_sigpipe)
|
||||
{
|
||||
auto socket = TRY(adopt_nonnull_own_or_enomem(new (nothrow) LocalSocket(prevent_sigpipe)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue