[c5808b41] | 1 | /*
|
---|
[2f19103] | 2 | * Copyright (c) 2015 Jiri Svoboda
|
---|
[c5808b41] | 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup tcp
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
[032bbe7] | 34 | * @file TCP transmission queue
|
---|
[c5808b41] | 35 | */
|
---|
| 36 |
|
---|
[6df418c4] | 37 | #include <adt/list.h>
|
---|
[7cf7ded] | 38 | #include <errno.h>
|
---|
| 39 | #include <fibril_synch.h>
|
---|
[c5808b41] | 40 | #include <byteorder.h>
|
---|
| 41 | #include <io/log.h>
|
---|
[32105348] | 42 | #include <macros.h>
|
---|
| 43 | #include <mem.h>
|
---|
[6df418c4] | 44 | #include <stdlib.h>
|
---|
[32105348] | 45 | #include "conn.h"
|
---|
[8218b6b] | 46 | #include "ncsim.h"
|
---|
[762b48a] | 47 | #include "pdu.h"
|
---|
[c5808b41] | 48 | #include "rqueue.h"
|
---|
| 49 | #include "segment.h"
|
---|
[6df418c4] | 50 | #include "seq_no.h"
|
---|
[c5808b41] | 51 | #include "tqueue.h"
|
---|
[1812a0d] | 52 | #include "tcp.h"
|
---|
[c5808b41] | 53 | #include "tcp_type.h"
|
---|
| 54 |
|
---|
[7cf7ded] | 55 | #define RETRANSMIT_TIMEOUT (2*1000*1000)
|
---|
| 56 |
|
---|
| 57 | static void retransmit_timeout_func(void *arg);
|
---|
| 58 | static void tcp_tqueue_timer_set(tcp_conn_t *conn);
|
---|
| 59 | static void tcp_tqueue_timer_clear(tcp_conn_t *conn);
|
---|
| 60 |
|
---|
| 61 | int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn)
|
---|
[6df418c4] | 62 | {
|
---|
| 63 | tqueue->conn = conn;
|
---|
[78192cc7] | 64 | tqueue->timer = fibril_timer_create(&conn->lock);
|
---|
[7cf7ded] | 65 | if (tqueue->timer == NULL)
|
---|
| 66 | return ENOMEM;
|
---|
| 67 |
|
---|
[6df418c4] | 68 | list_initialize(&tqueue->list);
|
---|
[7cf7ded] | 69 |
|
---|
| 70 | return EOK;
|
---|
| 71 | }
|
---|
| 72 |
|
---|
[704586fb] | 73 | void tcp_tqueue_clear(tcp_tqueue_t *tqueue)
|
---|
| 74 | {
|
---|
| 75 | tcp_tqueue_timer_clear(tqueue->conn);
|
---|
| 76 | }
|
---|
| 77 |
|
---|
[7cf7ded] | 78 | void tcp_tqueue_fini(tcp_tqueue_t *tqueue)
|
---|
| 79 | {
|
---|
| 80 | if (tqueue->timer != NULL) {
|
---|
| 81 | fibril_timer_destroy(tqueue->timer);
|
---|
| 82 | tqueue->timer = NULL;
|
---|
| 83 | }
|
---|
[6df418c4] | 84 | }
|
---|
| 85 |
|
---|
[c5808b41] | 86 | void tcp_tqueue_ctrl_seg(tcp_conn_t *conn, tcp_control_t ctrl)
|
---|
| 87 | {
|
---|
| 88 | tcp_segment_t *seg;
|
---|
| 89 |
|
---|
[a1a101d] | 90 | log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_tqueue_ctrl_seg(%p, %u)", conn, ctrl);
|
---|
[c5808b41] | 91 |
|
---|
| 92 | seg = tcp_segment_make_ctrl(ctrl);
|
---|
| 93 | tcp_tqueue_seg(conn, seg);
|
---|
[9787a93] | 94 | tcp_segment_delete(seg);
|
---|
[c5808b41] | 95 | }
|
---|
| 96 |
|
---|
| 97 | void tcp_tqueue_seg(tcp_conn_t *conn, tcp_segment_t *seg)
|
---|
| 98 | {
|
---|
[6df418c4] | 99 | tcp_segment_t *rt_seg;
|
---|
| 100 | tcp_tqueue_entry_t *tqe;
|
---|
| 101 |
|
---|
[a1a101d] | 102 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_seg(%p, %p)", conn->name, conn,
|
---|
[23fe06c] | 103 | seg);
|
---|
[6df418c4] | 104 |
|
---|
| 105 | /*
|
---|
| 106 | * Add segment to retransmission queue
|
---|
| 107 | */
|
---|
| 108 |
|
---|
| 109 | if (seg->len > 0) {
|
---|
| 110 | rt_seg = tcp_segment_dup(seg);
|
---|
| 111 | if (rt_seg == NULL) {
|
---|
[a1a101d] | 112 | log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
|
---|
[6df418c4] | 113 | /* XXX Handle properly */
|
---|
| 114 | return;
|
---|
| 115 | }
|
---|
| 116 |
|
---|
| 117 | tqe = calloc(1, sizeof(tcp_tqueue_entry_t));
|
---|
| 118 | if (tqe == NULL) {
|
---|
[a1a101d] | 119 | log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
|
---|
[6df418c4] | 120 | /* XXX Handle properly */
|
---|
| 121 | return;
|
---|
| 122 | }
|
---|
| 123 |
|
---|
[7cf7ded] | 124 | tqe->conn = conn;
|
---|
[6df418c4] | 125 | tqe->seg = rt_seg;
|
---|
[74c99b5] | 126 | rt_seg->seq = conn->snd_nxt;
|
---|
| 127 |
|
---|
[6df418c4] | 128 | list_append(&tqe->link, &conn->retransmit.list);
|
---|
[7cf7ded] | 129 |
|
---|
| 130 | /* Set retransmission timer */
|
---|
| 131 | tcp_tqueue_timer_set(conn);
|
---|
[6df418c4] | 132 | }
|
---|
[c5808b41] | 133 |
|
---|
[7cf7ded] | 134 | tcp_prepare_transmit_segment(conn, seg);
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | void tcp_prepare_transmit_segment(tcp_conn_t *conn, tcp_segment_t *seg)
|
---|
| 138 | {
|
---|
[32105348] | 139 | /*
|
---|
| 140 | * Always send ACK once we have received SYN, except for RST segments.
|
---|
| 141 | * (Spec says we should always send ACK once connection has been
|
---|
| 142 | * established.)
|
---|
| 143 | */
|
---|
| 144 | if (tcp_conn_got_syn(conn) && (seg->ctrl & CTL_RST) == 0)
|
---|
| 145 | seg->ctrl |= CTL_ACK;
|
---|
| 146 |
|
---|
| 147 | seg->seq = conn->snd_nxt;
|
---|
[c5808b41] | 148 | conn->snd_nxt += seg->len;
|
---|
[32105348] | 149 |
|
---|
[4f3f6285] | 150 | tcp_conn_transmit_segment(conn, seg);
|
---|
[c5808b41] | 151 | }
|
---|
| 152 |
|
---|
[32105348] | 153 | /** Transmit data from the send buffer.
|
---|
| 154 | *
|
---|
| 155 | * @param conn Connection
|
---|
| 156 | */
|
---|
| 157 | void tcp_tqueue_new_data(tcp_conn_t *conn)
|
---|
| 158 | {
|
---|
[d9ce049] | 159 | size_t avail_wnd;
|
---|
[8c7a054] | 160 | size_t xfer_seqlen;
|
---|
| 161 | size_t snd_buf_seqlen;
|
---|
[32105348] | 162 | size_t data_size;
|
---|
[8c7a054] | 163 | tcp_control_t ctrl;
|
---|
[6896409c] | 164 | bool send_fin;
|
---|
[8c7a054] | 165 |
|
---|
[32105348] | 166 | tcp_segment_t *seg;
|
---|
| 167 |
|
---|
[a1a101d] | 168 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name);
|
---|
[32105348] | 169 |
|
---|
[d9ce049] | 170 | /* Number of free sequence numbers in send window */
|
---|
| 171 | avail_wnd = (conn->snd_una + conn->snd_wnd) - conn->snd_nxt;
|
---|
[8c7a054] | 172 | snd_buf_seqlen = conn->snd_buf_used + (conn->snd_buf_fin ? 1 : 0);
|
---|
[d9ce049] | 173 |
|
---|
[8c7a054] | 174 | xfer_seqlen = min(snd_buf_seqlen, avail_wnd);
|
---|
[70253688] | 175 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: snd_buf_seqlen = %zu, SND.WND = %" PRIu32 ", "
|
---|
[6896409c] | 176 | "xfer_seqlen = %zu", conn->name, snd_buf_seqlen, conn->snd_wnd,
|
---|
[8c7a054] | 177 | xfer_seqlen);
|
---|
[32105348] | 178 |
|
---|
[0edaf0f6] | 179 | if (xfer_seqlen == 0)
|
---|
[32105348] | 180 | return;
|
---|
| 181 |
|
---|
| 182 | /* XXX Do not always send immediately */
|
---|
| 183 |
|
---|
[6896409c] | 184 | send_fin = conn->snd_buf_fin && xfer_seqlen == snd_buf_seqlen;
|
---|
| 185 | data_size = xfer_seqlen - (send_fin ? 1 : 0);
|
---|
| 186 |
|
---|
| 187 | if (send_fin) {
|
---|
[a1a101d] | 188 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: Sending out FIN.", conn->name);
|
---|
[8c7a054] | 189 | /* We are sending out FIN */
|
---|
| 190 | ctrl = CTL_FIN;
|
---|
| 191 | } else {
|
---|
| 192 | ctrl = 0;
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | seg = tcp_segment_make_data(ctrl, conn->snd_buf, data_size);
|
---|
[32105348] | 196 | if (seg == NULL) {
|
---|
[a1a101d] | 197 | log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failure.");
|
---|
[32105348] | 198 | return;
|
---|
| 199 | }
|
---|
| 200 |
|
---|
| 201 | /* Remove data from send buffer */
|
---|
| 202 | memmove(conn->snd_buf, conn->snd_buf + data_size,
|
---|
| 203 | conn->snd_buf_used - data_size);
|
---|
| 204 | conn->snd_buf_used -= data_size;
|
---|
[6896409c] | 205 |
|
---|
| 206 | if (send_fin)
|
---|
| 207 | conn->snd_buf_fin = false;
|
---|
[32105348] | 208 |
|
---|
[bbf159a] | 209 | fibril_condvar_broadcast(&conn->snd_buf_cv);
|
---|
| 210 |
|
---|
| 211 | if (send_fin)
|
---|
| 212 | tcp_conn_fin_sent(conn);
|
---|
| 213 |
|
---|
[32105348] | 214 | tcp_tqueue_seg(conn, seg);
|
---|
[1bdf307d] | 215 | tcp_segment_delete(seg);
|
---|
[32105348] | 216 | }
|
---|
| 217 |
|
---|
[d9ce049] | 218 | /** Remove ACKed segments from retransmission queue and possibly transmit
|
---|
| 219 | * more data.
|
---|
[4c55a64] | 220 | *
|
---|
| 221 | * This should be called when SND.UNA is updated due to incoming ACK.
|
---|
| 222 | */
|
---|
[d9ce049] | 223 | void tcp_tqueue_ack_received(tcp_conn_t *conn)
|
---|
[4c55a64] | 224 | {
|
---|
[6df418c4] | 225 | link_t *cur, *next;
|
---|
| 226 |
|
---|
[a1a101d] | 227 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_ack_received(%p)", conn->name,
|
---|
[23fe06c] | 228 | conn);
|
---|
[6df418c4] | 229 |
|
---|
| 230 | cur = conn->retransmit.list.head.next;
|
---|
| 231 |
|
---|
| 232 | while (cur != &conn->retransmit.list.head) {
|
---|
| 233 | next = cur->next;
|
---|
| 234 |
|
---|
| 235 | tcp_tqueue_entry_t *tqe = list_get_instance(cur,
|
---|
| 236 | tcp_tqueue_entry_t, link);
|
---|
| 237 |
|
---|
| 238 | if (seq_no_segment_acked(conn, tqe->seg, conn->snd_una)) {
|
---|
| 239 | /* Remove acknowledged segment */
|
---|
| 240 | list_remove(cur);
|
---|
| 241 |
|
---|
| 242 | if ((tqe->seg->ctrl & CTL_FIN) != 0) {
|
---|
[a1a101d] | 243 | log_msg(LOG_DEFAULT, LVL_DEBUG, "Fin has been acked");
|
---|
| 244 | log_msg(LOG_DEFAULT, LVL_DEBUG, "SND.UNA=%" PRIu32
|
---|
[74c99b5] | 245 | " SEG.SEQ=%" PRIu32 " SEG.LEN=%" PRIu32,
|
---|
| 246 | conn->snd_una, tqe->seg->seq, tqe->seg->len);
|
---|
[6df418c4] | 247 | /* Our FIN has been acked */
|
---|
| 248 | conn->fin_is_acked = true;
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | tcp_segment_delete(tqe->seg);
|
---|
| 252 | free(tqe);
|
---|
[7cf7ded] | 253 |
|
---|
| 254 | /* Reset retransmission timer */
|
---|
| 255 | tcp_tqueue_timer_set(conn);
|
---|
[6df418c4] | 256 | }
|
---|
| 257 |
|
---|
| 258 | cur = next;
|
---|
| 259 | }
|
---|
[d9ce049] | 260 |
|
---|
[7cf7ded] | 261 | /* Clear retransmission timer if the queue is empty. */
|
---|
| 262 | if (list_empty(&conn->retransmit.list))
|
---|
| 263 | tcp_tqueue_timer_clear(conn);
|
---|
| 264 |
|
---|
[6df418c4] | 265 | /* Possibly transmit more data */
|
---|
[d9ce049] | 266 | tcp_tqueue_new_data(conn);
|
---|
[4c55a64] | 267 | }
|
---|
| 268 |
|
---|
[7cf7ded] | 269 | void tcp_conn_transmit_segment(tcp_conn_t *conn, tcp_segment_t *seg)
|
---|
| 270 | {
|
---|
[a1a101d] | 271 | log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_transmit_segment(%p, %p)",
|
---|
[23fe06c] | 272 | conn->name, conn, seg);
|
---|
[7cf7ded] | 273 |
|
---|
| 274 | seg->wnd = conn->rcv_wnd;
|
---|
| 275 |
|
---|
| 276 | if ((seg->ctrl & CTL_ACK) != 0)
|
---|
| 277 | seg->ack = conn->rcv_nxt;
|
---|
| 278 | else
|
---|
| 279 | seg->ack = 0;
|
---|
| 280 |
|
---|
| 281 | tcp_transmit_segment(&conn->ident, seg);
|
---|
| 282 | }
|
---|
| 283 |
|
---|
[2f19103] | 284 | void tcp_transmit_segment(inet_ep2_t *epp, tcp_segment_t *seg)
|
---|
[c5808b41] | 285 | {
|
---|
[c0f3460] | 286 | log_msg(LOG_DEFAULT, LVL_DEBUG,
|
---|
[779541b] | 287 | "tcp_transmit_segment(l:(%u),f:(%u), %p)",
|
---|
[2f19103] | 288 | epp->local.port, epp->remote.port, seg);
|
---|
| 289 |
|
---|
[a1a101d] | 290 | log_msg(LOG_DEFAULT, LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32,
|
---|
[7cf7ded] | 291 | seg->seq, seg->wnd);
|
---|
[6896409c] | 292 |
|
---|
| 293 | tcp_segment_dump(seg);
|
---|
[c5808b41] | 294 | /*
|
---|
| 295 | tcp_pdu_prepare(conn, seg, &data, &len);
|
---|
| 296 | tcp_pdu_transmit(data, len);
|
---|
| 297 | */
|
---|
[1812a0d] | 298 | // tcp_rqueue_bounce_seg(sp, seg);
|
---|
[7cf7ded] | 299 | // tcp_ncsim_bounce_seg(sp, seg);
|
---|
[1812a0d] | 300 |
|
---|
| 301 | tcp_pdu_t *pdu;
|
---|
| 302 |
|
---|
[2f19103] | 303 | if (tcp_pdu_encode(epp, seg, &pdu) != EOK) {
|
---|
[a1a101d] | 304 | log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");
|
---|
[1812a0d] | 305 | return;
|
---|
| 306 | }
|
---|
| 307 |
|
---|
| 308 | tcp_transmit_pdu(pdu);
|
---|
| 309 | tcp_pdu_delete(pdu);
|
---|
[7cf7ded] | 310 | }
|
---|
| 311 |
|
---|
| 312 | static void retransmit_timeout_func(void *arg)
|
---|
| 313 | {
|
---|
| 314 | tcp_conn_t *conn = (tcp_conn_t *) arg;
|
---|
| 315 | tcp_tqueue_entry_t *tqe;
|
---|
| 316 | tcp_segment_t *rt_seg;
|
---|
| 317 | link_t *link;
|
---|
| 318 |
|
---|
[a1a101d] | 319 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
|
---|
[704586fb] | 320 |
|
---|
[78192cc7] | 321 | tcp_conn_lock(conn);
|
---|
[0edaf0f6] | 322 |
|
---|
[704586fb] | 323 | if (conn->cstate == st_closed) {
|
---|
[a1a101d] | 324 | log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
|
---|
[78192cc7] | 325 | tcp_conn_unlock(conn);
|
---|
[0edaf0f6] | 326 | tcp_conn_delref(conn);
|
---|
[704586fb] | 327 | return;
|
---|
| 328 | }
|
---|
| 329 |
|
---|
[7cf7ded] | 330 | link = list_first(&conn->retransmit.list);
|
---|
| 331 | if (link == NULL) {
|
---|
[a1a101d] | 332 | log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");
|
---|
[78192cc7] | 333 | tcp_conn_unlock(conn);
|
---|
[0edaf0f6] | 334 | tcp_conn_delref(conn);
|
---|
[7cf7ded] | 335 | return;
|
---|
| 336 | }
|
---|
| 337 |
|
---|
| 338 | tqe = list_get_instance(link, tcp_tqueue_entry_t, link);
|
---|
| 339 |
|
---|
| 340 | rt_seg = tcp_segment_dup(tqe->seg);
|
---|
| 341 | if (rt_seg == NULL) {
|
---|
[a1a101d] | 342 | log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
|
---|
[78192cc7] | 343 | tcp_conn_unlock(conn);
|
---|
[0edaf0f6] | 344 | tcp_conn_delref(conn);
|
---|
[7cf7ded] | 345 | /* XXX Handle properly */
|
---|
| 346 | return;
|
---|
| 347 | }
|
---|
| 348 |
|
---|
[a1a101d] | 349 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmitting segment", conn->name);
|
---|
[7cf7ded] | 350 | tcp_conn_transmit_segment(tqe->conn, rt_seg);
|
---|
| 351 |
|
---|
| 352 | /* Reset retransmission timer */
|
---|
[7c15d6f] | 353 | fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
|
---|
| 354 | retransmit_timeout_func, (void *) conn);
|
---|
[0edaf0f6] | 355 |
|
---|
[78192cc7] | 356 | tcp_conn_unlock(conn);
|
---|
| 357 |
|
---|
| 358 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);
|
---|
[7cf7ded] | 359 | }
|
---|
| 360 |
|
---|
| 361 | /** Set or re-set retransmission timer */
|
---|
| 362 | static void tcp_tqueue_timer_set(tcp_conn_t *conn)
|
---|
| 363 | {
|
---|
[78192cc7] | 364 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name);
|
---|
[7cf7ded] | 365 |
|
---|
[0edaf0f6] | 366 | /* Clear first to make sure we update refcnt correctly */
|
---|
| 367 | tcp_tqueue_timer_clear(conn);
|
---|
| 368 |
|
---|
| 369 | tcp_conn_addref(conn);
|
---|
[78192cc7] | 370 | fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
|
---|
[7cf7ded] | 371 | retransmit_timeout_func, (void *) conn);
|
---|
[78192cc7] | 372 |
|
---|
| 373 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);
|
---|
[7cf7ded] | 374 | }
|
---|
| 375 |
|
---|
| 376 | /** Clear retransmission timer */
|
---|
| 377 | static void tcp_tqueue_timer_clear(tcp_conn_t *conn)
|
---|
| 378 | {
|
---|
[78192cc7] | 379 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name);
|
---|
[7cf7ded] | 380 |
|
---|
[78192cc7] | 381 | if (fibril_timer_clear_locked(conn->retransmit.timer) == fts_active)
|
---|
[0edaf0f6] | 382 | tcp_conn_delref(conn);
|
---|
[78192cc7] | 383 |
|
---|
| 384 | log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);
|
---|
[c5808b41] | 385 | }
|
---|
| 386 |
|
---|
| 387 | /**
|
---|
| 388 | * @}
|
---|
| 389 | */
|
---|