Skip to content

Commit

Permalink
Merge pull request #73 from patrickbkr/write-bytes
Browse files Browse the repository at this point in the history
Make `.write`s Promise result return the written bytes
  • Loading branch information
jnthn authored Mar 3, 2024
2 parents 7caec64 + 51e4974 commit 488576c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/IO/Socket/Async/SSL.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,15 @@ class IO::Socket::Async::SSL {
));
return $p;
}
OpenSSL::SSL::SSL_write($!ssl, $b, $b.bytes);
my $ret = OpenSSL::SSL::SSL_write($!ssl, $b, $b.bytes);
my $p = start {
$lib-lock.protect: {
self!flush-read-bio();
# The following doesn't race on $p assignment due to the
# holding of $lib-lock in the code with the assignment.
@!outstanding-writes .= grep({ $_ !=== $p });
}
$ret
}
@!outstanding-writes.push($p);
$p
Expand Down

0 comments on commit 488576c

Please sign in to comment.