http.cpp revision 62fb024c605bcbe2d5fefd31d391cd9fee484150
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * IPRT - HTTP communication API.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright (C) 2012-2013 Oracle Corporation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * available from http://www.virtualbox.org. This file is free software;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * General Public License (GPL) as published by the Free Software
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * The contents of this file may alternatively be used under the terms
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * of the Common Development and Distribution License Version 1.0
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * VirtualBox OSE distribution, in which case the provisions of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CDDL are applicable instead of those of the GPL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * You may elect to license modified versions of this file under the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * terms and conditions of either the GPL or the CDDL or both.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/*******************************************************************************
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync* Header Files *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync*******************************************************************************/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/*******************************************************************************
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync* Structures and Typedefs *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync*******************************************************************************/
long lLastResp;
char *pcszCAFile;
bool fAbort;
typedef struct RTHTTPMEMCHUNK
return VERR_HTTP_INIT_FAILED;
if (!pCurl)
return VERR_HTTP_INIT_FAILED;
if (!pHttpInt)
return VERR_NO_MEMORY;
return VINF_SUCCESS;
if (!hHttp)
return cbAll;
return VINF_SUCCESS;
int rcCurl;
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return rc;
return VERR_INVALID_PARAMETER;
if (uPort != 0)
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return VINF_SUCCESS;
if (!cHeaders)
return VINF_SUCCESS;
return VERR_INVALID_PARAMETER;
return VINF_SUCCESS;
if (cert)
unsigned cb;
if (rc1 > 0)
if (*pabSha1)
if (rc1 > 0)
if (*pabSha512)
return rc;
return VERR_NO_MEMORY;
return VINF_SUCCESS;
switch (rcCurl)
case CURLE_URL_MALFORMAT:
case CURLE_COULDNT_CONNECT:
case CURLE_SSL_CONNECT_ERROR:
case CURLE_SSL_CACERT:
case CURLE_SSL_CACERT_BADFILE:
return rc;
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return rc;
return rc;
return cbWritten;
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
return VERR_INTERNAL_ERROR;
int rc = RTFileOpen(&hFile, pszDstFile, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_READWRITE);
return rc;