Changeset 87063 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-http.cpp
- Timestamp:
- Dec 9, 2020 1:53:36 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-http.cpp
r87061 r87063 76 76 * Internal functions * 77 77 *********************************************************************************************************************************/ 78 79 /** 80 * Return the HTTP server transfer for a specific transfer ID. 81 * 82 * @returns Pointer to HTTP server transfer if found, NULL if not found. 83 * @param pSrv HTTP server instance. 84 * @param idTransfer Transfer ID to return HTTP server transfer for. 85 */ 78 86 static PSHCLHTTPSERVERTRANSFER shClTransferHttpServerGetTransferById(PSHCLHTTPSERVER pSrv, SHCLTRANSFERID idTransfer) 79 87 { … … 206 214 * Public functions * 207 215 *********************************************************************************************************************************/ 216 217 /** 218 * Creates a new Shared Clipboard HTTP server instance, extended version. 219 * 220 * @returns VBox status code. 221 * @param pSrv HTTP server instance to create. 222 * @param uPort TCP port number to use. 223 */ 208 224 int ShClTransferHttpServerCreateEx(PSHCLHTTPSERVER pSrv, uint16_t uPort) 209 225 { … … 249 265 } 250 266 267 /** 268 * Creates a new Shared Clipboard HTTP server instance. 269 * 270 * This does automatic probing of TCP ports if one already is being used. 271 * 272 * @returns VBox status code. 273 * @param pSrv HTTP server instance to create. 274 * @param puPort Where to return the TCP port number being used on success. 275 */ 251 276 int ShClTransferHttpServerCreate(PSHCLHTTPSERVER pSrv, uint16_t *puPort) 252 277 { … … 281 306 } 282 307 308 /** 309 * Destroys a Shared Clipboard HTTP server instance. 310 * 311 * @returns VBox status code. 312 * @param pSrv HTTP server instance to destroy. 313 */ 283 314 int ShClTransferHttpServerDestroy(PSHCLHTTPSERVER pSrv) 284 315 { … … 302 333 } 303 334 335 /** 336 * Registers a Shared Clipboard transfer to a HTTP server instance. 337 * 338 * @returns VBox status code. 339 * @param pSrv HTTP server instance to register transfer for. 340 * @param pTransfer Transfer to register. 341 */ 304 342 int ShClTransferHttpServerRegisterTransfer(PSHCLHTTPSERVER pSrv, PSHCLTRANSFER pTransfer) 305 343 { … … 341 379 } 342 380 381 /** 382 * Unregisters a formerly registered Shared Clipboard transfer. 383 * 384 * @returns VBox status code. 385 * @param pSrv HTTP server instance to unregister transfer from. 386 * @param pTransfer Transfer to unregister. 387 */ 343 388 int ShClTransferHttpServerUnregisterTransfer(PSHCLHTTPSERVER pSrv, PSHCLTRANSFER pTransfer) 344 389 { … … 361 406 pSrvTx = NULL; 362 407 408 Assert(pSrv->cTransfers); 363 409 pSrv->cTransfers--; 364 410 … … 372 418 } 373 419 420 /** 421 * Returns whether a specific transfer ID is registered with a HTTP server instance or not. 422 * 423 * @returns \c true if the transfer ID is registered, \c false if not. 424 * @param pSrv HTTP server instance. 425 * @param idTransfer Transfer ID to check for. 426 */ 374 427 bool ShClTransferHttpServerHasTransfer(PSHCLHTTPSERVER pSrv, SHCLTRANSFERID idTransfer) 375 428 { … … 385 438 } 386 439 440 /** 441 * Returns the used TCP port number of a HTTP server instance. 442 * 443 * @returns TCP port number. 0 if not specified yet. 444 * @param pSrv HTTP server instance to return port for. 445 */ 387 446 uint16_t ShClTransferHttpServerGetPort(PSHCLHTTPSERVER pSrv) 388 447 { … … 398 457 } 399 458 459 /** 460 * Returns the number of registered HTTP server transfers of a HTTP server instance. 461 * 462 * @returns Number of registered transfers. 463 * @param pSrv HTTP server instance to return registered transfers for. 464 */ 400 465 uint32_t ShClTransferHttpServerGetTransferCount(PSHCLHTTPSERVER pSrv) 401 466 { … … 411 476 } 412 477 478 /** 479 * Returns the host name (scheme) of a HTTP server instance. 480 * 481 * @param pSrv HTTP server instance to return host name (scheme) for. 482 * 483 * @returns Host name (scheme). 484 */ 413 485 static const char *shClTransferHttpServerGetHost(PSHCLHTTPSERVER pSrv) 414 486 { … … 417 489 } 418 490 491 /** 492 * Returns an allocated string with a HTTP server instance's address. 493 * 494 * @returns Allocated string with a HTTP server instance's address, or NULL on OOM. 495 * Needs to be free'd by the caller using RTStrFree(). 496 * @param pSrv HTTP server instance to return address for. 497 */ 419 498 char *ShClTransferHttpServerGetAddressA(PSHCLHTTPSERVER pSrv) 420 499 { … … 430 509 } 431 510 511 /** 512 * Returns an allocated string with the URL of a given Shared Clipboard transfer ID. 513 * 514 * @returns Allocated string with the URL of a given Shared Clipboard transfer ID, or NULL if not found. 515 * Needs to be free'd by the caller using RTStrFree(). 516 * @param pSrv HTTP server instance to return URL for. 517 */ 432 518 char *ShClTransferHttpServerGetUrlA(PSHCLHTTPSERVER pSrv, SHCLTRANSFERID idTransfer) 433 519 {
Note:
See TracChangeset
for help on using the changeset viewer.