Changeset 3732:4525972e9c84 in roaraudio for roard/req.c
- Timestamp:
- 04/25/10 22:36:06 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/req.c
r3729 r3732 294 294 int sock = clients_get_fh(client); 295 295 int16_t * d = (int16_t*)mes->data; 296 struct roard_listen * lsock; 297 int listening; 296 298 int fh; 297 299 int i; … … 332 334 return -1; 333 335 336 listening = d[1] & ROAR_CLIENTPASS_FLAG_LISTEN; 337 338 if ( listening ) 339 d[1] -= ROAR_CLIENTPASS_FLAG_LISTEN; 340 334 341 if ( d[1] != 0 ) // flags 335 342 return -1; 336 343 337 if ( d[2] != ROAR_PROTO_ROARAUDIO ) // protocol 338 return -1; 339 340 if ( d[3] != ROAR_BYTEORDER_NETWORK ) // byte order 341 return -1; 342 343 if ( (client = clients_new()) == -1 ) 344 return -1; 345 346 if ( clients_set_fh(client, fh) == -1 ) { 347 clients_delete(client); 348 return -1; 349 } 350 351 if ( clients_get(client, &c) != -1 ) { 352 roar_nnode_new_from_fh(&(c->nnode), fh, 1); 344 if ( listening ) { 345 if ( get_listen(&lsock, NULL) == -1 ) 346 return -1; 347 348 lsock->socket = fh; 349 lsock->proto = d[2]; 350 } else { 351 if ( d[2] != ROAR_PROTO_ROARAUDIO ) // protocol 352 return -1; 353 354 if ( d[3] != ROAR_BYTEORDER_NETWORK ) // byte order 355 return -1; 356 357 if ( (client = clients_new()) == -1 ) 358 return -1; 359 360 if ( clients_set_fh(client, fh) == -1 ) { 361 clients_delete(client); 362 return -1; 363 } 364 365 if ( clients_get(client, &c) != -1 ) { 366 roar_nnode_new_from_fh(&(c->nnode), fh, 1); 367 } 353 368 } 354 369
Note: See TracChangeset
for help on using the changeset viewer.