Skip to content

Commit

Permalink
don't set write_wanted in response to packet being acked
Browse files Browse the repository at this point in the history
  • Loading branch information
jthomas43 committed Dec 26, 2023
1 parent 639c33a commit 6a6a29a
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ should_cork (udx_stream_t *stream) {
if (winsz < len) len = winsz;

if (mss > len && wrtsz > len && stream->pkts_inflight > 0) {
debug_printf("cork: should cork stream. seq=%u len=%u\n", stream->seq, wrtsz);
// debug_printf("cork: should cork stream. seq=%u len=%u\n", stream->seq, wrtsz);
return true;
}

Expand All @@ -295,11 +295,6 @@ stream_write_wanted (udx_stream_t *stream) {
return false;
}

// return stream->write_wanted ||
// stream->unordered.len > 0 ||
// ((stream->write_queue.len > 0 ||
// stream->retransmit_queue.len > 0) && get_window_bytes(stream) > 0 && !should_cork(stream));

if (stream->write_wanted) {
return true;
}
Expand Down Expand Up @@ -653,18 +648,6 @@ get_stream (udx_socket_t *socket) {
return NULL;
}

// void
// udx__initialize_stream_queue (udx_socket_t *socket) {
// assert(socket->stream_queue.len == 0);
//
// for (uint32_t i = 0; i < socket->udx->streams_len; i++) {
// udx_stream_t *stream = socket->udx->streams[i];
// if (stream->socket == socket && stream_write_wanted(stream)) {
// udx__fifo_push(&socket->stream_queue, stream);
// }
// }
// }

// sending packets
// while the socket is writable send until EAGAIN or all packets are sent.
// 1. get a packet to send 'get_packet'. if no packet is available it will return NULL
Expand Down Expand Up @@ -812,7 +795,7 @@ udx__shift_packet (udx_socket_t *socket) {
if (mss < len) len = mss;
// cork
if (mss > len && wrtsz > len && stream->pkts_inflight > 0) {
debug_printf("cork: should cork packet len=%u, data=%.*s\n", wrtsz, wrtsz, write->buf.base + write->bytes_acked + write->bytes_inflight);
// debug_printf("cork: should cork packet len=%u, data=%.*s\n", wrtsz, wrtsz, write->buf.base + write->bytes_acked + write->bytes_inflight);
return NULL;
}

Expand Down Expand Up @@ -1149,9 +1132,6 @@ ack_packet (udx_stream_t *stream, uint32_t seq, int sack) {
return 0;
}

stream->write_wanted |= UDX_STREAM_WRITE_WANT_STATE;
update_poll(stream->socket);

if (stream->mtu_state == UDX_MTU_STATE_SEARCH && stream->mtu_probe_count > 0 && pkt->is_mtu_probe) {
debug_printf("mtu: probe acked seq=%d mtu=%d->%d sack=%d\n", seq, stream->mtu, stream->mtu_probe_size, sack);

Expand Down

0 comments on commit 6a6a29a

Please sign in to comment.