Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-transfers.h
r86949 r87058 36 36 #include <iprt/critsect.h> 37 37 #include <iprt/fs.h> 38 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 39 # include <iprt/http-server.h> 40 #endif 38 41 #include <iprt/list.h> 39 42 … … 762 765 } SHCLTRANSFERREPORT, *PSHCLTRANSFERREPORT; 763 766 767 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 768 typedef struct _SHCLHTTPSERVER 769 { 770 /** Critical section for serializing access. */ 771 RTCRITSECT CritSect; 772 /** Handle of the HTTP server instance. */ 773 RTHTTPSERVER hHTTPServer; 774 /** Port number the HTTP server is running on. 0 if not running. */ 775 uint16_t uPort; 776 /** List of registered HTTP transfers. */ 777 RTLISTANCHOR lstTransfers; 778 /** Number of registered HTTP transfers. */ 779 uint32_t cTransfers; 780 /** Cached response data. */ 781 RTHTTPSERVERRESP Resp; 782 } SHCLHTTPSERVER; 783 typedef SHCLHTTPSERVER *PSHCLHTTPSERVER; 784 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP */ 785 764 786 /** 765 787 * Structure for keeping Shared Clipboard transfer context around. … … 779 801 /** Number of total transfers (in list). */ 780 802 uint16_t cTransfers; 803 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 804 /** HTTP server instance for this transfer context. */ 805 SHCLHTTPSERVER HttpServer; 806 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP */ 781 807 } SHCLTRANSFERCTX, *PSHCLTRANSFERCTX; 782 808 … … 883 909 int ShClTransferCtxTransferUnregister(PSHCLTRANSFERCTX pTransferCtx, SHCLTRANSFERID idTransfer); 884 910 911 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 912 int ShClTransferHttpServerCreate(PSHCLHTTPSERVER pSrv, PSHCLTRANSFERCTX pCtx); 913 int ShClTransferHttpServerCreateEx(PSHCLHTTPSERVER pSrv, uint16_t uPort); 914 int ShClTransferHttpServerDestroy(PSHCLHTTPSERVER pSrv); 915 int ShClTransferHttpServerRegisterTransfer(PSHCLHTTPSERVER pSrv, PSHCLTRANSFER pTransfer); 916 int ShClTransferHttpServerUnregisterTransfer(PSHCLHTTPSERVER pSrv, PSHCLTRANSFER pTransfer); 917 bool ShClTransferHttpServerHasTransfer(PSHCLHTTPSERVER pSrv, SHCLTRANSFERID idTransfer); 918 uint16_t ShClTransferHttpServerGetPort(PSHCLHTTPSERVER pSrv); 919 uint32_t ShClTransferHttpServerGetTransferCount(PSHCLHTTPSERVER pSrv); 920 char *ShClTransferHttpServerGetAddressA(PSHCLHTTPSERVER pSrv); 921 char *ShClTransferHttpServerGetUrlA(PSHCLHTTPSERVER pSrv, SHCLTRANSFERID idTransfer); 922 #endif 923 885 924 void ShClFsObjFromIPRT(PSHCLFSOBJINFO pDst, PCRTFSOBJINFO pSrc); 886 925 -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r86959 r87058 59 59 # include <iprt/cpp/list.h> 60 60 # include <iprt/cpp/ministring.h> 61 # include <VBox/GuestHost/SharedClipboard-transfers.h> 61 62 #endif 62 63 … … 1427 1428 } 1428 1429 else 1429 rc = ShClX11RequestDataForX11Callback(pCtx->pFrontend, Format, 1430 &pv, &cb); 1430 { 1431 rc = ShClX11RequestDataForX11Callback(pCtx->pFrontend, Format, &pv, &cb); 1432 } 1431 1433 1432 1434 if (RT_SUCCESS(rc)) … … 2050 2052 if (RT_SUCCESS(RTStrValidateEncodingEx((char *)pvSrc, cbSrc, 0))) 2051 2053 { 2052 /* URI lists on X are string separated with "\r\n". */2054 /* URI lists on X are strings separated with "\r\n". */ 2053 2055 RTCList<RTCString> lstRootEntries = RTCString((char *)pvSrc, cbSrc).split("\r\n"); 2054 2056 for (size_t i = 0; i < lstRootEntries.size(); ++i) … … 2057 2059 AssertPtrBreakStmt(pszEntry, VERR_INVALID_PARAMETER); 2058 2060 2059 LogFlowFunc(("URI list entry '%s'\n", pszEntry)); 2061 rc = RTStrAAppend((char **)&pvDst, "http://localhost"); 2062 AssertRCBreakStmt(rc, VERR_NO_MEMORY); 2063 cbDst += (uint32_t)strlen(pszEntry); 2064 2065 2066 2067 /** @todo BUGBUG Fix port! */ 2068 /** @todo Add port + UUID (virtual path). */ 2060 2069 2061 2070 rc = RTStrAAppend((char **)&pvDst, pszEntry); 2062 2071 AssertRCBreakStmt(rc, VERR_NO_MEMORY); 2063 2072 cbDst += (uint32_t)strlen(pszEntry); 2073 2074 LogFlowFunc(("URI list entry '%s'\n", (char *)pvDst)); 2064 2075 2065 2076 rc = RTStrAAppend((char **)&pvDst, "\r\n");
Note:
See TracChangeset
for help on using the changeset viewer.

