Changeset 21523 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Jul 13, 2009 8:54:34 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r21028 r21523 319 319 } 320 320 321 void crVBoxServerAddClient(uint32_t u32ClientID) 322 { 323 CRClient *newClient = (CRClient *) crCalloc(sizeof(CRClient)); 324 321 int32_t crVBoxServerAddClient(uint32_t u32ClientID) 322 { 323 CRClient *newClient; 324 325 if (cr_server.numClients>=CR_MAX_CLIENTS) 326 { 327 return VERR_MAX_THRDS_REACHED; 328 } 329 330 newClient = (CRClient *) crCalloc(sizeof(CRClient)); 325 331 crDebug("crServer: AddClient u32ClientID=%d", u32ClientID); 326 332 … … 336 342 337 343 crServerAddToRunQueue(newClient); 344 345 return VINF_SUCCESS; 338 346 } 339 347 … … 363 371 } 364 372 365 voidcrVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer)373 int32_t crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer) 366 374 { 367 375 CRClient *pClient; … … 380 388 pClient = cr_server.clients[i]; 381 389 CRASSERT(pClient); 390 391 if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; 382 392 383 393 CRASSERT(pBuffer); … … 436 446 437 447 CRASSERT(!pClient->conn->allow_redir_ptr || crNetNumMessages(pClient->conn)==0); 448 449 return VINF_SUCCESS; 438 450 } 439 451 … … 456 468 CRASSERT(pClient); 457 469 470 if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; 471 458 472 if (pClient->conn->cbHostBuffer > *pcbBuffer) 459 473 { … … 478 492 479 493 return VINF_SUCCESS; 494 } 495 496 int32_t crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor) 497 { 498 CRClient *pClient; 499 int32_t i; 500 501 for (i = 0; i < cr_server.numClients; i++) 502 { 503 if (cr_server.clients[i] && cr_server.clients[i]->conn 504 && cr_server.clients[i]->conn->u32ClientID==u32ClientID) 505 { 506 break; 507 } 508 } 509 pClient = cr_server.clients[i]; 510 CRASSERT(pClient); 511 512 pClient->conn->vMajor = vMajor; 513 pClient->conn->vMinor = vMinor; 514 515 if (vMajor != CR_PROTOCOL_VERSION_MAJOR 516 || vMinor != CR_PROTOCOL_VERSION_MINOR) 517 { 518 return VERR_NOT_SUPPORTED; 519 } 520 else return VINF_SUCCESS; 480 521 } 481 522
Note:
See TracChangeset
for help on using the changeset viewer.