Changeset 5146:716400712348 in roaraudio for roard/req.c


Ignore:
Timestamp:
10/15/11 12:48:07 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Moved error frame handling into proto functions (pr0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r5065 r5146  
    141141                           client, roar_autht2str(authmes.type), authmes.type, (long long unsigned int)authmes.len); 
    142142 
     143 ROAR_DBG("req_on_auth(client=%i,...): CALL auth_client_ckeck(cs=%p, &authmes=%p, &next=%p)", client, cs, &authmes, &next); 
    143144 ret = auth_client_ckeck(cs, &authmes, &next); 
     145 ROAR_DBG("req_on_auth(client=%i,...): RET %i // next=%s(%i)", client, ret, roar_autht2str(next), next); 
    144146 
    145147 if ( ret != 1 ) { 
     148  ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 
     149 
    146150  if ( next != -1 ) { 
     151   ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 
    147152   memset(&authmes, 0, sizeof(authmes)); 
    148153 
     
    152157    return -1; 
    153158 
    154    if ( roar_err_int(&error_frame) == -1 ) 
    155     return -1; 
     159   ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 
     160 
     161   if ( roar_err_init(&error_frame) == -1 ) 
     162    return -1; 
     163 
     164   ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 
    156165 
    157166   error_frame.ra_errno = ROAR_ERROR_PERM; 
     
    159168 
    160169   error_data   = roar_err_buildmsg(mes, &error_frame); 
     170   ROAR_DBG("req_on_auth(client=%i,...): error_data=%p", client, error_data); 
    161171 
    162172   memcpy(error_data, error_mes.data, error_mes.datalen); 
     
    164174   mes->cmd     = ROAR_CMD_ERROR; 
    165175   mes->pos     = g_pos; 
     176 
     177   ROAR_DBG("req_on_auth(client=%i,...): mes=%p{.datalen=%i}", client, mes, (int)mes->datalen); 
     178   ROAR_DBG("req_on_auth(client=%i,...) = 0 // cmd=ERROR", client); 
    166179   return 0; 
    167180  } 
    168181 
     182  ROAR_DBG("req_on_auth(client=%i,...) = 0", client); 
    169183  return -1; 
    170184 } 
     
    173187 mes->pos     = g_pos; 
    174188 mes->datalen = 0; 
     189 
     190 ROAR_DBG("req_on_auth(client=%i,...) = 0", client); 
    175191 return 0; 
    176192} 
Note: See TracChangeset for help on using the changeset viewer.