Path: blob/master/thirdparty/miniupnpc/src/miniwget_private.h
9904 views
/* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */1/* Project : miniupnp2* Author : Thomas Bernard3* Copyright (c) 2018-2025 Thomas Bernard4* This software is subject to the conditions detailed in the5* LICENCE file provided in this distribution.6* */7#ifndef MINIWGET_INTERNAL_H_INCLUDED8#define MINIWGET_INTERNAL_H_INCLUDED910/*! \file miniwget_private.h11* \brief Lightweight HTTP client private API12*/13#include "miniupnpc_socketdef.h"1415/*! \brief Read a HTTP response from a socket16*17* Processed HTTP headers :18* - `Content-Length`19* - `Transfer-encoding`20* return a pointer to the content buffer, which length is saved21* to the length parameter.22* \param[in] s socket23* \param[out] size returned content buffer size24* \param[out] status_code HTTP Status code25* \return malloc'ed content buffer26*/27void * getHTTPResponse(SOCKET s, int * size, int * status_code);2829/*! \brief parse a HTTP URL30*31* URL formats supported :32* - `http://192.168.1.1/path/xxx`33* - `http://192.168.1.1:8080/path/xxx`34* - `http://[2a00:1234:5678:90ab::123]/path/xxx`35* - `http://[2a00:1234:5678:90ab::123]:8080/path/xxx`36* - `http://[fe80::1234:5678:90ab%%eth0]/path/xxx`37* - `http://[fe80::1234:5678:90ab%%eth0]:8080/path/xxx`38*39* `%` may be encoded as `%25`40*41* \param[in] url URL to parse42* \param[out] hostname hostname part of the URL (size of MAXHOSTNAMELEN+1)43* \param[out] port set to the port specified in the URL or 8044* \param[out] path set to the begining of the path part of the URL45* \param[out] scope_id set to the interface id if specified in the46* link-local IPv6 address47* \return 0 for failure, 1 for success48*/49int parseURL(const char * url,50char * hostname, unsigned short * port, char * * path,51unsigned int * scope_id);5253#endif545556