Changeset 4468:f8d2cccafc74 in roaraudio


Ignore:
Timestamp:
10/10/10 17:50:11 (8 years ago)
Author:
phi
Branch:
default
Message:

do very basic auth stuff

Location:
roard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r4467 r4468  
    8686    ns->blockc   = 0; 
    8787    ns->waits    = NULL; 
    88     ns->acclev   = ACCLEV_ALL; 
     88    ns->acclev   = ACCLEV_NONE; 
    8989 
    9090    g_clients[i] = ns; 
     
    206206 
    207207 *client = ROAR_CLIENT(g_clients[id]); 
     208 
     209 if ( *client == NULL ) 
     210  return -1; 
     211 
     212 return 0; 
     213} 
     214 
     215int clients_get_server (int id, struct roar_client_server ** client) { 
     216 _CHECK_CID(id); 
     217 
     218 *client = g_clients[id]; 
    208219 
    209220 if ( *client == NULL ) 
  • roard/include/client.h

    r4467 r4468  
    8484int clients_set_proto  (int id, int    proto); 
    8585int clients_get        (int id, struct roar_client ** client); 
     86int clients_get_server (int id, struct roar_client_server ** client); 
    8687int clients_get_fh     (int id); 
    8788 
  • roard/req.c

    r4442 r4468  
    5858 
    5959int req_on_identify    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 
    60  struct roar_client * c; 
     60 struct roar_client_server * cs; 
     61 struct roar_client        * c; 
    6162 int max_len; 
    6263 
     
    6465  return -1; 
    6566 
    66  clients_get(client, &c); 
     67 clients_get_server(client, &cs); 
     68 
     69 c = ROAR_CLIENT(cs); 
    6770 
    6871 if ( mes->data[0] == 1 ) { 
     
    7982  c->name[max_len] = 0; 
    8083 
     84  // we set the acclevel to IDENTED here. 
     85  // if it is alreay > IDENTED we reset it anyway 
     86  // as potential auth relevent data changed. 
     87  cs->acclev = ACCLEV_IDENTED; 
     88 
    8189  mes->cmd     = ROAR_CMD_OK; 
    8290  mes->pos     = g_pos; 
     
    92100 
    93101int req_on_auth        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 
     102 struct roar_client_server * cs; 
     103 
     104 clients_get_server(client, &cs); 
     105 
    94106 // TODO: add code to support some auth. 
     107 
     108 cs->acclev = ACCLEV_ALL; 
     109 
    95110 mes->cmd     = ROAR_CMD_OK; 
    96111 mes->pos     = g_pos; 
Note: See TracChangeset for help on using the changeset viewer.