Changeset 4e716180 in mainline for uspace/srv/net/udp/assoc.c


Ignore:
Timestamp:
2013-05-03T21:14:39Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
716357f
Parents:
1c7ba2d (diff), 5d1cb8a (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:

Merge simple DNS resolver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/assoc.c

    r1c7ba2d r4e716180  
    279279
    280280        fibril_mutex_lock(&assoc->lock);
    281         while (list_empty(&assoc->rcv_queue)) {
     281        while (list_empty(&assoc->rcv_queue) && !assoc->reset) {
    282282                log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - waiting");
    283283                fibril_condvar_wait(&assoc->rcv_queue_cv, &assoc->lock);
     284        }
     285
     286        if (assoc->reset) {
     287                log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - association was reset");
     288                fibril_mutex_unlock(&assoc->lock);
     289                return ECONNABORTED;
    284290        }
    285291
     
    323329}
    324330
     331/** Reset association.
     332 *
     333 * This causes any pendingreceive operations to return immediately with
     334 * UDP_ERESET.
     335 */
     336void udp_assoc_reset(udp_assoc_t *assoc)
     337{
     338        fibril_mutex_lock(&assoc->lock);
     339        assoc->reset = true;
     340        fibril_condvar_broadcast(&assoc->rcv_queue_cv);
     341        fibril_mutex_unlock(&assoc->lock);
     342}
     343
    325344static int udp_assoc_queue_msg(udp_assoc_t *assoc, udp_sockpair_t *sp,
    326345    udp_msg_t *msg)
Note: See TracChangeset for help on using the changeset viewer.