Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset de229f8e in mainline


Ignore:
Timestamp:
2010-11-04T20:25:27Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
a63ff7d
Parents:
f3cb50e
Message:

Use udp_release_and_return() instead of the equivalent but longer pattern.

File:
1 edited

Legend:

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

    rf3cb50e rde229f8e  
    636636        // get udp header
    637637        data = packet_get_data(packet);
    638         if (!data) {
    639                 pq_release_remote(udp_globals.net_phone, packet_id);
    640                 return NO_DATA;
    641         }
     638        if (!data)
     639                return udp_release_and_return(packet, NO_DATA);
    642640        header = (udp_header_ref) data;
    643641
     
    645643        result = packet_get_addr(packet, (uint8_t **) &addr, NULL);
    646644        rc = tl_set_address_port(addr, result, ntohs(header->source_port));
    647         if (rc != EOK) {
    648                 pq_release_remote(udp_globals.net_phone, packet_id);
    649                 return rc;
    650         }
     645        if (rc != EOK)
     646                return udp_release_and_return(packet, rc);
    651647        *addrlen = (size_t) result;
    652648
     
    666662                return rc;
    667663
    668         // release the packet
    669664        dyn_fifo_pop(&socket->received);
    670         pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
    671 
    672         // return the total length
    673         return (int) length;
     665
     666        // release the packet and return the total length
     667        return udp_release_and_return(packet, (int) length);
    674668}
    675669
Note: See TracChangeset for help on using the changeset viewer.