Changeset 1e2e0c1e in mainline for uspace/srv/net/tl/tcp/tcp.c


Ignore:
Timestamp:
2010-02-17T21:15:03Z (14 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e6b7b198
Parents:
bfd7aac
Message:
  • change in the pq_add interface
File:
1 edited

Legend:

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

    rbfd7aac r1e2e0c1e  
    613613                next_packet = pq_detach( packet );
    614614                length = packet_get_data_length( packet );
    615                 tmp_packet = pq_add( socket_data->incoming, packet, new_sequence_number, length );
    616                 if( ! tmp_packet ){
     615                if( ERROR_OCCURRED( pq_add( & socket_data->incoming, packet, new_sequence_number, length ))){
    617616                        // remove the corrupted packets
    618617                        pq_release( tcp_globals.net_phone, packet_get_id( packet ));
    619618                        pq_release( tcp_globals.net_phone, packet_get_id( next_packet ));
    620619                }else{
    621                         socket_data->incoming = tmp_packet;
    622620                        while( next_packet ){
    623621                                new_sequence_number += length;
     
    939937        packet_t        next;
    940938        packet_t        acknowledged = NULL;
    941         packet_t        first;
    942939        uint32_t        old;
    943940
     
    981978                                        }
    982979                                        // add to acknowledged or release
    983                                         first = pq_add( acknowledged, packet, 0, 0 );
    984                                         if( first ){
    985                                                 acknowledged = first;
    986                                         }else{
     980                                        if( pq_add( & acknowledged, packet, 0, 0 ) != EOK ){
    987981                                                pq_release( tcp_globals.net_phone, packet_get_id( packet ));
    988982                                        }
     
    15081502int     tcp_queue_packet( socket_core_ref socket, tcp_socket_data_ref socket_data, packet_t packet, size_t data_length ){
    15091503        ERROR_DECLARE;
    1510         packet_t                first;
    15111504
    15121505        assert( socket );
     
    15161509        ERROR_PROPAGATE( tcp_queue_prepare_packet( socket, socket_data, packet, data_length ));
    15171510
    1518         first = pq_add( socket_data->outgoing, packet, socket_data->next_outgoing, data_length );
    1519         if( ! first ){
    1520                 return tcp_release_and_return( packet, EINVAL );
    1521         }
    1522         socket_data->outgoing = first;
     1511        if( ERROR_OCCURRED( pq_add( & socket_data->outgoing, packet, socket_data->next_outgoing, data_length ))){
     1512                return tcp_release_and_return( packet, ERROR_CODE );
     1513        }
    15231514        socket_data->next_outgoing += data_length;
    15241515        return EOK;
Note: See TracChangeset for help on using the changeset viewer.