FFmpeg
Loading...
Searching...
No Matches
http.h File Reference
#include "libavutil/error.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  HTTPStatusLine
 Parsed form of a response status line. More...
 

Macros

#define HTTP_HEADERS_SIZE   4096
 

Functions

int ff_http_parse_status_line (void *logctx, const char *line, HTTPStatusLine *st)
 Parse the status line of an HTTP response.
 
void ff_http_init_auth_state (URLContext *dest, const URLContext *src)
 Initialize the authentication state based on another HTTP URLContext.
 
int ff_http_do_new_request (URLContext *h, const char *uri)
 Send a new HTTP request, reusing the old connection.
 
int ff_http_do_new_request2 (URLContext *h, const char *uri, AVDictionary **options)
 Send a new HTTP request, reusing the old connection.
 
const char * ff_http_get_new_location (URLContext *h)
 
static int ff_http_averror (int status_code, int default_averror)
 

Macro Definition Documentation

◆ HTTP_HEADERS_SIZE

#define HTTP_HEADERS_SIZE   4096

Definition at line 28 of file http.h.

Function Documentation

◆ ff_http_parse_status_line()

int ff_http_parse_status_line ( void * logctx,
const char * line,
HTTPStatusLine * st )

Parse the status line of an HTTP response.

Parameters
logctxcontext used for logging, may be NULL
lineNUL terminated status line, without its trailing CRLF
stfilled in with the parsed status line
Returns
0 on success, a negative AVERROR code on failure

Definition at line 893 of file http.c.

Referenced by process_line(), and test().

◆ ff_http_init_auth_state()

void ff_http_init_auth_state ( URLContext * dest,
const URLContext * src )

Initialize the authentication state based on another HTTP URLContext.

This can be used to pre-initialize the authentication parameters if they are known beforehand, to avoid having to do an initial failing request just to get the parameters.

Parameters
destURL context whose authentication state gets updated
srcURL context whose authentication state gets copied

Definition at line 239 of file http.c.

◆ ff_http_do_new_request()

int ff_http_do_new_request ( URLContext * h,
const char * uri )

Send a new HTTP request, reusing the old connection.

Parameters
hpointer to the resource
uriuri used to perform the request
Returns
a negative value if an error condition occurred, 0 otherwise

Definition at line 545 of file http.c.

Referenced by dashenc_io_open(), hlsenc_io_open(), and rtmp_http_send_cmd().

◆ ff_http_do_new_request2()

int ff_http_do_new_request2 ( URLContext * h,
const char * uri,
AVDictionary ** options )

Send a new HTTP request, reusing the old connection.

Parameters
hpointer to the resource
uriuri used to perform the request
optionsA dictionary filled with HTTP options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL.
Returns
a negative value if an error condition occurred, 0 otherwise

Definition at line 549 of file http.c.

Referenced by ff_http_do_new_request(), and open_url_keepalive().

◆ ff_http_get_new_location()

const char * ff_http_get_new_location ( URLContext * h)

Definition at line 615 of file http.c.

Referenced by exchange_sdp().

◆ ff_http_averror()

static int ff_http_averror ( int status_code,
int default_averror )
inlinestatic

Definition at line 87 of file http.h.

Referenced by check_http_code(), ff_rtsp_averror(), header_callback(), and http_open_cnx().