Changeset 153cc76a in mainline for uspace/srv/net/tl/tcp/tqueue.c


Ignore:
Timestamp:
2011-12-23T16:42:22Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e1b130
Parents:
4291215 (diff), 2f0dd2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/tcp/tqueue.c

    r4291215 r153cc76a  
    188188                /* We are sending out FIN */
    189189                ctrl = CTL_FIN;
    190                 tcp_conn_fin_sent(conn);
    191190        } else {
    192191                ctrl = 0;
     
    206205        if (send_fin)
    207206                conn->snd_buf_fin = false;
     207
     208        fibril_condvar_broadcast(&conn->snd_buf_cv);
     209
     210        if (send_fin)
     211                tcp_conn_fin_sent(conn);
    208212
    209213        tcp_tqueue_seg(conn, seg);
     
    313317        log_msg(LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
    314318
     319        fibril_mutex_lock(&conn->lock);
     320
    315321        if (conn->cstate == st_closed) {
    316322                log_msg(LVL_DEBUG, "Connection already closed.");
     323                fibril_mutex_unlock(&conn->lock);
     324                tcp_conn_delref(conn);
    317325                return;
    318326        }
     
    321329        if (link == NULL) {
    322330                log_msg(LVL_DEBUG, "Nothing to retransmit");
     331                fibril_mutex_unlock(&conn->lock);
     332                tcp_conn_delref(conn);
    323333                return;
    324334        }
     
    329339        if (rt_seg == NULL) {
    330340                log_msg(LVL_ERROR, "Memory allocation failed.");
     341                fibril_mutex_unlock(&conn->lock);
     342                tcp_conn_delref(conn);
    331343                /* XXX Handle properly */
    332344                return;
     
    338350        /* Reset retransmission timer */
    339351        tcp_tqueue_timer_set(tqe->conn);
     352
     353        fibril_mutex_unlock(&conn->lock);
     354        tcp_conn_delref(conn);
    340355}
    341356
     
    345360        log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);
    346361
    347         (void) retransmit_timeout_func;
     362        /* Clear first to make sure we update refcnt correctly */
     363        tcp_tqueue_timer_clear(conn);
     364
     365        tcp_conn_addref(conn);
    348366        fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
    349367            retransmit_timeout_func, (void *) conn);
     
    355373        log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name);
    356374
    357         fibril_timer_clear(conn->retransmit.timer);
     375        if (fibril_timer_clear(conn->retransmit.timer) == fts_active)
     376                tcp_conn_delref(conn);
    358377}
    359378
Note: See TracChangeset for help on using the changeset viewer.