Changeset 4256:6b0da49a8ef9 in roaraudio


Ignore:
Timestamp:
08/25/10 18:30:09 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added debug lions for roar_socket_recv_fh()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r4073 r4256  
    349349 size_t           locallen[1] = {1}; 
    350350 
    351  if ( sock < 0 ) 
    352   return -1; 
     351 ROAR_DBG("roar_socket_recv_fh(sock=%i, mes=%p, len=%p) = ?", sock, mes, len); 
     352 
     353 if ( sock < 0 ) { 
     354  ROAR_DBG("roar_socket_recv_fh(sock=%i, mes=%p, len=%p) = -1 // invalid socket", sock, mes, len); 
     355  return -1; 
     356 } 
    353357 
    354358 if ( len == NULL ) { 
     
    367371 msg.msg_controllen = _SCMR_CONTROLLEN; 
    368372 
    369  if ( (*len = recvmsg(sock, &msg, 0)) == -1 ) 
    370   return -1; 
    371  
    372  if ( msg.msg_controllen != _SCMR_CONTROLLEN ) 
    373   return -1; 
    374  
     373 if ( (*len = recvmsg(sock, &msg, 0)) == -1 ) { 
     374  ROAR_DBG("roar_socket_recv_fh(sock=%i, mes=%p, len=%p) = -1 // can not read from socket", sock, mes, len); 
     375  return -1; 
     376 } 
     377 
     378 if ( msg.msg_controllen != _SCMR_CONTROLLEN ) { 
     379  ROAR_DBG("roar_socket_recv_fh(sock=%i, mes=%p, len=%p) = -1 // control len is wrong", sock, mes, len); 
     380  return -1; 
     381 } 
     382 
     383 ROAR_DBG("roar_socket_recv_fh(sock=%i, mes=%p, len=%p) = %i", sock, mes, len, *(int *)CMSG_DATA(cmptr)); 
    375384 return *(int *)CMSG_DATA(cmptr); 
    376385#else 
Note: See TracChangeset for help on using the changeset viewer.