Changeset 99937 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- May 23, 2023 3:38:52 PM (19 months ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/http-server.cpp
r98103 r99937 794 794 while (cbToRead) 795 795 { 796 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRead, p vHandle, pvBuf, RT_MIN(cbBuf, cbToRead), &cbRead);796 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRead, pReq, pvHandle, pvBuf, RT_MIN(cbBuf, cbToRead), &cbRead); 797 797 if (RT_FAILURE(rc)) 798 798 break; … … 815 815 int rc2 = rc; /* Save rc. */ 816 816 817 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnClose, p vHandle);817 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnClose, pReq, pvHandle); 818 818 819 819 if (RT_FAILURE(rc2)) /* Restore original rc on failure. */ … … 963 963 while (cbToRead) 964 964 { 965 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRead, p vHandle, pvBuf, RT_MIN(cbBuf, cbToRead), &cbRead);965 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRead, pReq, pvHandle, pvBuf, RT_MIN(cbBuf, cbToRead), &cbRead); 966 966 if (RT_FAILURE(rc)) 967 967 break; … … 985 985 int rc2 = rc; /* Save rc. */ 986 986 987 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnClose, p vHandle);987 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnClose, pReq, pvHandle); 988 988 989 989 if (RT_FAILURE(rc2)) /* Restore original rc on failure. */ … … 1021 1021 || RTFS_IS_FILE(objInfo.Attr.fMode); 1022 1022 1023 /* No symlinks and other stuff notallowed. */1023 /* No symlinks and other stuff allowed. */ 1024 1024 } 1025 1025 else … … 1142 1142 /* 1143 1143 * Parse HTTP version to use. 1144 * We're picky here e: Only HTTP 1.1 is supported by now.1144 * We're picky here: Only HTTP 1.1 is supported by now. 1145 1145 */ 1146 1146 const char *pszVer = ppapszFirstLine[2]; … … 1209 1209 LogFlowFunc(("Request %s %s\n", RTHttpMethodToStr(pReq->enmMethod), pReq->pszUrl)); 1210 1210 1211 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRequestBegin, pReq); 1212 1211 1213 unsigned i = 0; 1212 1214 for (; i < RT_ELEMENTS(g_aMethodMap); i++) … … 1225 1227 } 1226 1228 1229 RTHTTPSERVER_HANDLE_CALLBACK_VA(pfnRequestEnd, pReq); 1230 1227 1231 if (i == RT_ELEMENTS(g_aMethodMap)) 1228 1232 enmSts = RTHTTPSTATUS_NOTIMPLEMENTED; … … 1233 1237 enmSts = RTHTTPSTATUS_BADREQUEST; 1234 1238 1235 if (enmSts != RTHTTPSTATUS_INTERNAL_NOT_SET) 1236 { 1237 int rc2 = rtHttpServerSendResponseSimple(pClient, enmSts); 1238 if (RT_SUCCESS(rc)) 1239 rc = rc2; 1240 } 1239 /* Make sure to return at least *something* to the client, to prevent hangs. */ 1240 if (enmSts == RTHTTPSTATUS_INTERNAL_NOT_SET) 1241 enmSts = RTHTTPSTATUS_INTERNALSERVERERROR; 1242 1243 int rc2 = rtHttpServerSendResponseSimple(pClient, enmSts); 1244 if (RT_SUCCESS(rc)) 1245 rc = rc2; 1241 1246 1242 1247 LogFlowFuncLeaveRC(rc); … … 1269 1274 if (RT_FAILURE(rc)) 1270 1275 { 1271 Log FlowFunc(("RTTcpSelectOne=%Rrc (cWaitMs=%RU64)\n", rc, cWaitMs));1276 Log2Func(("RTTcpSelectOne=%Rrc (cWaitMs=%RU64)\n", rc, cWaitMs)); 1272 1277 if (rc == VERR_TIMEOUT) 1273 1278 { … … 1277 1282 tsLastReadMs = RTTimeMilliTS(); 1278 1283 const uint64_t tsDeltaMs = pClient->State.msKeepAlive - (RTTimeMilliTS() - tsLastReadMs); 1279 Log FlowFunc(("tsLastReadMs=%RU64, tsDeltaMs=%RU64\n", tsLastReadMs, tsDeltaMs));1280 Log 3Func(("Keep alive active (%RU32ms): %RU64ms remaining\n", pClient->State.msKeepAlive, tsDeltaMs));1284 Log2Func(("tsLastReadMs=%RU64, tsDeltaMs=%RU64\n", tsLastReadMs, tsDeltaMs)); 1285 Log2Func(("Keep alive active (%RU32ms): %RU64ms remaining\n", pClient->State.msKeepAlive, tsDeltaMs)); 1281 1286 if ( tsDeltaMs > cWaitMs 1282 1287 && tsDeltaMs < pClient->State.msKeepAlive) … … 1332 1337 } while (cbToRead); 1333 1338 1339 Log2Func(("Read client request done (%zu bytes) -> rc=%Rrc\n", cbReadTotal, rc)); 1340 1334 1341 if ( RT_SUCCESS(rc) 1335 1342 && cbReadTotal) 1336 1343 { 1337 LogFlowFunc(("Received client request (%zu bytes)\n", cbReadTotal));1338 1339 1344 rtHttpServerLogProto(pClient, false /* fWrite */, szReq); 1340 1345 -
trunk/src/VBox/Runtime/tools/RTHttpServer.cpp
r98103 r99937 521 521 } 522 522 523 static DECLCALLBACK(int) onRead(PRTHTTPCALLBACKDATA pData, void *pvHandle, void *pvBuf, size_t cbBuf, size_t *pcbRead) 524 { 523 static DECLCALLBACK(int) onRead(PRTHTTPCALLBACKDATA pData, 524 PRTHTTPSERVERREQ pReq, void *pvHandle, void *pvBuf, size_t cbBuf, size_t *pcbRead) 525 { 526 RT_NOREF(pReq); 527 525 528 PHTTPSERVERDATA pThis = (PHTTPSERVERDATA)pData->pvUser; 526 529 Assert(pData->cbUser == sizeof(HTTPSERVERDATA)); … … 554 557 } 555 558 556 static DECLCALLBACK(int) onClose(PRTHTTPCALLBACKDATA pData, void *pvHandle) 557 { 559 static DECLCALLBACK(int) onClose(PRTHTTPCALLBACKDATA pData, PRTHTTPSERVERREQ pReq, void *pvHandle) 560 { 561 RT_NOREF(pReq); 562 558 563 PHTTPSERVERDATA pThis = (PHTTPSERVERDATA)pData->pvUser; 559 564 Assert(pData->cbUser == sizeof(HTTPSERVERDATA));
Note:
See TracChangeset
for help on using the changeset viewer.