Changeset 87068 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-http.cpp
- Timestamp:
- Dec 9, 2020 2:53:08 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-http.cpp
r87067 r87068 182 182 } 183 183 184 /** 185 * Destroys a Shared Clipboard HTTP server instance, internal version. 186 * 187 * @returns VBox status code. 188 * @param pSrv Shared Clipboard HTTP server instance to destroy. 189 */ 184 190 int shClTransferHttpServerDestroyInternal(PSHCLHTTPSERVER pSrv) 185 191 { … … 195 201 RTHttpServerResponseDestroy(&pSrv->Resp); 196 202 203 pSrv->hHTTPServer = NIL_RTHTTPSERVER; 204 197 205 return RTCritSectDelete(&pSrv->CritSect); 198 206 } 199 207 208 /** 209 * Locks the critical section of a Shared Clipboard HTTP server instance. 210 * 211 * @param pSrv Shared Clipboard HTTP server instance to lock. 212 */ 200 213 DECLINLINE(void) shClTransferHttpServerLock(PSHCLHTTPSERVER pSrv) 201 214 { … … 204 217 } 205 218 219 /** 220 * Unlocks the critical section of a Shared Clipboard HTTP server instance. 221 * 222 * @param pSrv Shared Clipboard HTTP server instance to unlock. 223 */ 206 224 DECLINLINE(void) shClTransferHttpServerUnlock(PSHCLHTTPSERVER pSrv) 207 225 { … … 209 227 AssertRC(rc2); 210 228 } 211 212 213 /*********************************************************************************************************************************214 * Public functions *215 *********************************************************************************************************************************/216 229 217 230 /** … … 230 243 } 231 244 245 246 /********************************************************************************************************************************* 247 * Public functions * 248 *********************************************************************************************************************************/ 249 250 /** 251 * Initializes a new Shared Clipboard HTTP server instance. 252 * 253 * @param pSrv HTTP server instance to initialize. 254 */ 255 void ShClTransferHttpServerInit(PSHCLHTTPSERVER pSrv) 256 { 257 AssertPtrReturnVoid(pSrv); 258 259 shClTransferHttpServerInitInternal(pSrv); 260 } 261 232 262 /** 233 263 * Creates a new Shared Clipboard HTTP server instance, extended version. … … 240 270 { 241 271 AssertPtrReturn(pSrv, VERR_INVALID_POINTER); 242 243 shClTransferHttpServerInitInternal(pSrv);244 272 245 273 RTHTTPSERVERCALLBACKS Callbacks; … … 374 402 AssertReturn(cch, VERR_BUFFER_OVERFLOW); 375 403 404 pSrvTx->pTransfer = pTransfer; 405 376 406 RTListAppend(&pSrv->lstTransfers, &pSrvTx->Node); 377 378 407 pSrv->cTransfers++; 408 409 LogFunc(("pTransfer=%p, idTransfer=%RU16, szPath=%s -> %RU32 transfers\n", 410 pSrvTx->pTransfer, pSrvTx->pTransfer->State.uID, pSrvTx->szPathVirtual, pSrv->cTransfers)); 411 412 LogRel2(("Shared Clipboard: Registered HTTP transfer %RU16, now %RU32 HTTP transfers total\n", 413 pTransfer->State.uID, pSrv->cTransfers)); 379 414 } 380 415 } … … 385 420 shClTransferHttpServerUnlock(pSrv); 386 421 422 LogFlowFuncLeaveRC(rc); 387 423 return rc; 388 424 } … … 403 439 404 440 AssertReturn(pSrv->cTransfers, VERR_WRONG_ORDER); 441 442 int rc = VINF_SUCCESS; 405 443 406 444 PSHCLHTTPSERVERTRANSFER pSrvTx; … … 418 456 pSrv->cTransfers--; 419 457 420 shClTransferHttpServerUnlock(pSrv); 421 return VINF_SUCCESS; 458 LogFunc(("pTransfer=%p, idTransfer=%RU16, szPath=%s -> %RU32 transfers\n", 459 pSrvTx->pTransfer, pSrvTx->pTransfer->State.uID, pSrvTx->szPathVirtual, pSrv->cTransfers)); 460 461 LogRel2(("Shared Clipboard: Unregistered HTTP transfer %RU16, now %RU32 HTTP transfers total\n", 462 pTransfer->State.uID, pSrv->cTransfers)); 463 464 rc = VINF_SUCCESS; 465 break; 422 466 } 423 467 } 424 468 425 469 shClTransferHttpServerUnlock(pSrv); 426 return VERR_NOT_FOUND; 470 471 LogFlowFuncLeaveRC(rc); 472 return rc; 427 473 } 428 474
Note:
See TracChangeset
for help on using the changeset viewer.