Changeset 87029 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Dec 2, 2020 8:28:43 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141653
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/http-server.cpp
r87021 r87029 437 437 RT_NOREF(pClient); 438 438 439 #ifdef LOG GING_ENABLED439 #ifdef LOG_ENABLED 440 440 if (!pszData) /* Nothing to log? Bail out. */ 441 441 return; … … 478 478 * @param pClient Client to reply to. 479 479 * @param enmSts Status code to send. 480 * @param pHdrLst Header list to send. Optional and can be NULL. 481 */ 482 static int rtHttpServerSendResponseHdrEx(PRTHTTPSERVERCLIENT pClient, 483 RTHTTPSTATUS enmSts, PRTHTTPHEADERLIST pHdrLst) 484 { 485 char *pszHdr; 486 int rc = RTStrAPrintf(&pszHdr, 480 */ 481 static int rtHttpServerSendResponse(PRTHTTPSERVERCLIENT pClient, RTHTTPSTATUS enmSts) 482 { 483 char *pszResp; 484 int rc = RTStrAPrintf(&pszResp, 487 485 "%s %RU32 %s\r\n", RTHTTPVER_1_1_STR, enmSts, RTHttpStatusToStr(enmSts)); 488 486 AssertRCReturn(rc, rc); 489 487 rc = rtHttpServerWriteProto(pClient, pszResp); 488 RTStrFree(pszResp); 489 490 LogFlowFuncLeaveRC(rc); 491 return rc; 492 } 493 494 /** 495 * Main function for sending response headers back to the client. 496 * 497 * @returns VBox status code. 498 * @param pClient Client to reply to. 499 * @param pHdrLst Header list to send. Optional and can be NULL. 500 */ 501 static int rtHttpServerSendResponseHdrEx(PRTHTTPSERVERCLIENT pClient, PRTHTTPHEADERLIST pHdrLst) 502 { 490 503 RTHTTPHEADERLIST HdrLst; 491 rc = RTHttpHeaderListInit(&HdrLst);504 int rc = RTHttpHeaderListInit(&HdrLst); 492 505 AssertRCReturn(rc, rc); 493 506 … … 505 518 AssertRCReturn(rc, rc); 506 519 520 char *pszHdr = NULL; 521 507 522 size_t i = 0; 508 523 const char *pszEntry; … … 540 555 RTHttpHeaderListDestroy(HdrLst); 541 556 542 LogFlowFunc((" enmStatus=%s, rc=%Rrc\n", RTHttpStatusToStr(enmSts), rc));557 LogFlowFunc(("rc=%Rrc\n", rc)); 543 558 return rc; 544 559 } … … 554 569 static int rtHttpServerSendResponseEx(PRTHTTPSERVERCLIENT pClient, RTHTTPSTATUS enmSts, PRTHTTPHEADERLIST pHdrLst) 555 570 { 556 int rc = rtHttpServerSendResponseHdrEx(pClient, enmSts, pHdrLst); 571 int rc = rtHttpServerSendResponse(pClient, enmSts); 572 if (RT_SUCCESS(rc)) 573 rc = rtHttpServerSendResponseHdrEx(pClient, pHdrLst); 557 574 558 575 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.