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

Changeset 2e99277 in mainline for uspace/srv/net/tl/udp/udp.c


Ignore:
Timestamp:
2010-02-23T22:51:49Z (12 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master
Children:
aa85487
Parents:
8edacbc
Message:
  • inner message processing fixed
File:
1 edited

Legend:

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

    r8edacbc r2e99277  
    390390        fibril_rwlock_write_unlock( & udp_globals.lock );
    391391        async_msg_5( socket->phone, NET_SOCKET_RECEIVED, ( ipcarg_t ) socket->socket_id, packet_dimension->content, 0, 0, ( ipcarg_t ) fragments );
    392 /*      fibril_rwlock_write_unlock( & udp_globals.lock );
    393         async_msg_5( socket->phone, NET_SOCKET_RECEIVED, ( ipcarg_t ) socket->socket_id, 0, 0, 0, ( ipcarg_t ) fragments );
    394 */      return EOK;
     392        return EOK;
    395393}
    396394
     
    429427         *  - Answer the first IPC_M_CONNECT_TO_ME call.
    430428         */
    431         ipc_answer_0( callid, EOK );
     429        res = EOK;
     430        answer_count = 0;
    432431
    433432        // The client connection is only in one fibril and therefore no additional locks are needed.
     
    437436
    438437        while( keep_on_going ){
     438
     439                // answer the call
     440                answer_call( callid, res, & answer, answer_count );
     441
    439442                // refresh data
    440443                refresh_answer( & answer, & answer_count );
    441444
     445                // get the next call
    442446                callid = async_get_call( & call );
    443 //              printf( "message %d\n", IPC_GET_METHOD( * call ));
    444 
     447
     448                // process the call
    445449                switch( IPC_GET_METHOD( call )){
    446450                        case IPC_M_PHONE_HUNGUP:
    447451                                keep_on_going = false;
    448                                 res = EOK;
     452                                res = EHANGUP;
    449453                                break;
    450454                        case NET_SOCKET:
     
    514518                                break;
    515519                }
    516 
    517 //              printf( "res = %d\n", res );
    518 
    519                 answer_call( callid, res, & answer, answer_count );
    520520        }
    521521
     
    523523        socket_cores_release( udp_globals.net_phone, & local_sockets, & udp_globals.sockets, NULL );
    524524
    525         return EOK;
     525        return res;
    526526}
    527527
     
    618618        header->checksum = 0;
    619619        if( udp_globals.checksum_computing ){
    620 //              if( ERROR_OCCURRED( ip_get_route_req( udp_globals.ip_phone, IPPROTO_UDP, addr, addrlen, & device_id, & ip_header, & headerlen ))){
    621 //                      return udp_release_and_return( packet, ERROR_CODE );
    622 //              }
    623                 if( ERROR_OCCURRED( ip_client_set_pseudo_header_data_length( ip_header, headerlen, total_length + UDP_HEADER_SIZE))){
     620                // update the pseudo header
     621                if( ERROR_OCCURRED( ip_client_set_pseudo_header_data_length( ip_header, headerlen, total_length + UDP_HEADER_SIZE ))){
    624622                        free( ip_header );
    625623                        return udp_release_and_return( packet, ERROR_CODE );
    626624                }
     625                // finish the checksum computation
    627626                checksum = compute_checksum( checksum, ip_header, headerlen );
    628627                checksum = compute_checksum( checksum, ( uint8_t * ) header, sizeof( * header ));
Note: See TracChangeset for help on using the changeset viewer.