Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sctp] make write sync #344

Merged
merged 10 commits into from
Nov 15, 2022
Merged

Conversation

melekes
Copy link
Contributor

@melekes melekes commented Nov 8, 2022

There's no reason for it to be async because it just buffers the data in memory (actual IO is happening in a separate thread).

@melekes melekes marked this pull request as ready for review November 8, 2022 10:34
@melekes melekes requested review from algesten and k0nserv November 8, 2022 10:34
@melekes melekes marked this pull request as draft November 8, 2022 10:43
@melekes melekes marked this pull request as ready for review November 8, 2022 10:52
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Base: 59.36% // Head: 59.52% // Increases project coverage by +0.15% 🎉

Coverage data is based on head (bf7cd4c) compared to base (5b79f08).
Patch coverage: 76.36% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #344      +/-   ##
==========================================
+ Coverage   59.36%   59.52%   +0.15%     
==========================================
  Files         503      503              
  Lines       47666    47646      -20     
  Branches    12668    12583      -85     
==========================================
+ Hits        28299    28362      +63     
- Misses       9898     9902       +4     
+ Partials     9469     9382      -87     
Impacted Files Coverage Δ
sctp/examples/ping.rs 0.00% <0.00%> (ø)
sctp/examples/pong.rs 0.00% <0.00%> (ø)
sctp/src/stream/stream_test.rs 47.54% <0.00%> (-0.04%) ⬇️
.../association_internal/association_internal_test.rs 60.27% <33.33%> (+0.69%) ⬆️
sctp/src/association/association_test.rs 57.98% <68.08%> (+1.93%) ⬆️
sctp/src/queue/pending_queue.rs 88.57% <100.00%> (+10.79%) ⬆️
sctp/src/queue/queue_test.rs 68.65% <100.00%> (+6.72%) ⬆️
interceptor/src/stream_reader.rs 28.57% <0.00%> (-14.29%) ⬇️
sctp/src/timer/ack_timer.rs 79.31% <0.00%> (-3.45%) ⬇️
srtp/src/stream.rs 45.23% <0.00%> (-2.39%) ⬇️
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@melekes melekes self-assigned this Nov 9, 2022
melekes added a commit that referenced this pull request Nov 9, 2022
Returning Poll::Ready(Ok(n)) when write_fut is Some is incorrect since buf already contains new data and we should instead always return Poll::Ready(Ok(buf.len())) and update write_fut.

In the future, if/when we make write synchronous, this whole block could be simplified to just contain a single call (1 line) to write. See #344
Copy link
Member

@k0nserv k0nserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

sctp/src/queue/pending_queue.rs Show resolved Hide resolved
sctp/src/association/association_internal.rs Show resolved Hide resolved
sctp/src/association/association_internal.rs Show resolved Hide resolved
@melekes melekes merged commit 0acb5a4 into master Nov 15, 2022
@melekes melekes deleted the anton/failed-to-pop-from-pending-queue branch November 15, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants