http.cpp revision c7c179e9f819b2616cde22eaf988500140760069
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * IPRT - HTTP communication API.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (C) 2012-2013 Oracle Corporation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * available from http://www.virtualbox.org. This file is free software;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * General Public License (GPL) as published by the Free Software
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The contents of this file may alternatively be used under the terms
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of the Common Development and Distribution License Version 1.0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * VirtualBox OSE distribution, in which case the provisions of the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * CDDL are applicable instead of those of the GPL.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * You may elect to license modified versions of this file under the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * terms and conditions of either the GPL or the CDDL or both.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*******************************************************************************
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync* Header Files *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync*******************************************************************************/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*******************************************************************************
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync* Structures and Typedefs *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync*******************************************************************************/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** magic value */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** cURL handle */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** custom headers */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** CA certificate for HTTPS authentication check */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** abort the current HTTP request if true */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*******************************************************************************
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;
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;
for (unsigned i = 0; i < cHeaders; i++)
return VERR_INVALID_PARAMETER;
return VINF_SUCCESS;
if (cert)
unsigned cb;
if (rc1 > 0)
if (*pabSha1)
if (rc1 > 0)
if (*pabSha512)
return rc;
return VINF_SUCCESS;
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;
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;