VirtualBox

Changeset 87011 in vbox


Ignore:
Timestamp:
Nov 27, 2020 5:33:42 PM (4 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Docs. bugref:9874

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/http-server.cpp

    r87008 r87011  
    249249};
    250250
     251
    251252/*********************************************************************************************************************************
    252253*   Internal Functions                                                                                                           *
     
    296297*********************************************************************************************************************************/
    297298
     299/**
     300 * Guesses the HTTP MIME type based on a given file extension.
     301 *
     302 * Note: Has to include the beginning dot, e.g. ".mp3" (see IPRT).
     303 *
     304 * @returns Guessed MIME type, or "application/octet-stream" if not found.
     305 * @param   pszFileExt          File extension to guess MIME type for.
     306 */
    298307static const char *rtHttpServerGuessMIMEType(const char *pszFileExt)
    299308{
     
    311320}
    312321
     322/**
     323 * Allocates and initializes a new client request.
     324 *
     325 * @returns Pointer to the new client request, or NULL on OOM.
     326 *          Needs to be free'd with rtHttpServerReqFree().
     327 */
    313328static PRTHTTPSERVERREQ rtHttpServerReqAlloc(void)
    314329{
     
    322337}
    323338
     339/**
     340 * Frees a formerly allocated client request.
     341 *
     342 * @param   pReq                Pointer to client request to free.
     343 */
    324344static void rtHttpServerReqFree(PRTHTTPSERVERREQ pReq)
    325345{
     
    340360*********************************************************************************************************************************/
    341361
     362/**
     363 * Main function for sending a response back to the client.
     364 *
     365 * @returns VBox status code.
     366 * @param   pClient             Client to reply to.
     367 * @param   enmSts              Status code to send.
     368 * @param   pHdrLst             Header list to send. Optional and can be NULL.
     369 */
    342370static int rtHttpServerSendResponseHdrEx(PRTHTTPSERVERCLIENT pClient,
    343371                                         RTHTTPSTATUS enmSts, PRTHTTPHEADERLIST pHdrLst)
     
    405433
    406434/**
    407  * Replies with (three digit) response status back to the client.
     435 * Replies with (three digit) response status back to the client, extended version.
    408436 *
    409437 * @returns VBox status code.
     
    419447}
    420448
     449/**
     450 * Replies with (three digit) response status back to the client.
     451 *
     452 * @returns VBox status code.
     453 * @param   pClient             Client to reply to.
     454 * @param   enmSts              Status code to send.
     455 */
    421456static int rtHttpServerSendResponseSimple(PRTHTTPSERVERCLIENT pClient, RTHTTPSTATUS enmSts)
    422457{
     
    424459}
    425460
     461/**
     462 * Sends a chunk of the response body to the client.
     463 *
     464 * @returns VBox status code.
     465 * @param   pClient             Client to send body to.
     466 * @param   pvBuf               Data buffer to send.
     467 * @param   cbBuf               Size (in bytes) of data buffer to send.
     468 * @param   pcbSent             Where to store the sent bytes. Optional and can be NULL.
     469 */
    426470static int rtHttpServerSendResponseBody(PRTHTTPSERVERCLIENT pClient, void *pvBuf, size_t cbBuf, size_t *pcbSent)
    427471{
     
    434478}
    435479
     480/**
     481 * Resolves a VBox status code to a HTTP status code.
     482 *
     483 * @returns Resolved HTTP status code, or RTHTTPSTATUS_INTERNALSERVERERROR if not able to resolve.
     484 * @param   rc                  VBox status code to resolve.
     485 */
    436486static RTHTTPSTATUS rtHttpServerRcToStatus(int rc)
    437487{
     
    459509*********************************************************************************************************************************/
    460510
     511/**
     512 * Handler for the GET method.
     513 *
     514 * @returns VBox status code.
     515 * @param   pClient             Client to handle GET method for.
     516 * @param   pReq                Client request to handle.
     517 */
    461518static DECLCALLBACK(int) rtHttpServerHandleGET(PRTHTTPSERVERCLIENT pClient, PRTHTTPSERVERREQ pReq)
    462519{
     
    543600}
    544601
     602/**
     603 * Handler for the HEAD method.
     604 *
     605 * @returns VBox status code.
     606 * @param   pClient             Client to handle HEAD method for.
     607 * @param   pReq                Client request to handle.
     608 */
    545609static DECLCALLBACK(int) rtHttpServerHandleHEAD(PRTHTTPSERVERCLIENT pClient, PRTHTTPSERVERREQ pReq)
    546610{
     
    625689}
    626690
     691/**
     692 * Parses headers and fills them into a given header list.
     693 *
     694 * @returns VBox status code.
     695 * @param   hList               Header list to fill parsed headers in.
     696 * @param   pszReq              Request string with headers to parse.
     697 * @param   cbReq               Size (in bytes) of request string to parse.
     698 */
    627699static int rtHttpServerParseHeaders(RTHTTPHEADERLIST hList, char *pszReq, size_t cbReq)
    628700{
     
    638710}
    639711
     712/**
     713 * Main function for parsing and allocating a client request.
     714 *
     715 * @returns VBox status code.
     716 * @param   pClient             Client to parse request from.
     717 * @param   pszReq              Request string with headers to parse.
     718 * @param   cbReq               Size (in bytes) of request string to parse.
     719 * @param   ppReq               Where to store the allocated client request on success.
     720 *                              Needs to be free'd via rtHttpServerReqFree().
     721 */
    640722static int rtHttpServerParseRequest(PRTHTTPSERVERCLIENT pClient, char *pszReq, size_t cbReq,
    641723                                    PRTHTTPSERVERREQ *ppReq)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette