| FFmpeg
    | 
#include "config.h"#include "libavutil/avassert.h"#include "libavutil/avstring.h"#include "libavutil/opt.h"#include "libavutil/time.h"#include "libavutil/parseutils.h"#include "avformat.h"#include "http.h"#include "httpauth.h"#include "internal.h"#include "network.h"#include "os_support.h"#include "url.h"Go to the source code of this file.
| Data Structures | |
| struct | HTTPContext | 
| Macros | |
| #define | BUFFER_SIZE MAX_URL_SIZE | 
| #define | MAX_REDIRECTS 8 | 
| #define | HTTP_SINGLE 1 | 
| #define | HTTP_MUTLI 2 | 
| #define | MAX_EXPIRY 19 | 
| #define | WHITESPACES " \n\t\r" | 
| #define | OFFSET(x) offsetof(HTTPContext, x) | 
| #define | D AV_OPT_FLAG_DECODING_PARAM | 
| #define | E AV_OPT_FLAG_ENCODING_PARAM | 
| #define | DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) | 
| #define | HTTP_CLASS(flavor) | 
| Enumerations | |
| enum | HandshakeState { LOWER_PROTO, READ_HEADERS, WRITE_REPLY_HEADERS, FINISH } | 
| Functions | |
| static int | http_connect (URLContext *h, const char *path, const char *local_path, const char *hoststr, const char *auth, const char *proxyauth, int *new_location) | 
| static int | http_read_header (URLContext *h, int *new_location) | 
| static int | http_shutdown (URLContext *h, int flags) | 
| void | ff_http_init_auth_state (URLContext *dest, const URLContext *src) | 
| Initialize the authentication state based on another HTTP URLContext.  More... | |
| static int | http_open_cnx_internal (URLContext *h, AVDictionary **options) | 
| static int | http_open_cnx (URLContext *h, AVDictionary **options) | 
| int | ff_http_do_new_request (URLContext *h, const char *uri) | 
| Send a new HTTP request, reusing the old connection.  More... | |
| int | ff_http_averror (int status_code, int default_averror) | 
| static int | http_write_reply (URLContext *h, int status_code) | 
| static void | handle_http_errors (URLContext *h, int error) | 
| static int | http_handshake (URLContext *c) | 
| static int | http_listen (URLContext *h, const char *uri, int flags, AVDictionary **options) | 
| static int | http_open (URLContext *h, const char *uri, int flags, AVDictionary **options) | 
| static int | http_accept (URLContext *s, URLContext **c) | 
| static int | http_getc (HTTPContext *s) | 
| static int | http_get_line (HTTPContext *s, char *line, int line_size) | 
| static int | check_http_code (URLContext *h, int http_code, const char *end) | 
| static int | parse_location (HTTPContext *s, const char *p) | 
| static void | parse_content_range (URLContext *h, const char *p) | 
| static int | parse_content_encoding (URLContext *h, const char *p) | 
| static int | parse_icy (HTTPContext *s, const char *tag, const char *p) | 
| static int | parse_set_cookie_expiry_time (const char *exp_str, struct tm *buf) | 
| static int | parse_set_cookie (const char *set_cookie, AVDictionary **dict) | 
| static int | parse_cookie (HTTPContext *s, const char *p, AVDictionary **cookies) | 
| static int | cookie_string (AVDictionary *dict, char **cookies) | 
| static int | process_line (URLContext *h, char *line, int line_count, int *new_location) | 
| static int | get_cookies (HTTPContext *s, char **cookies, const char *path, const char *domain) | 
| Create a string containing cookie values for use as a HTTP cookie header field value for a particular path and domain from the cookie values stored in the HTTP protocol context.  More... | |
| static int | has_header (const char *str, const char *header) | 
| static int | http_buf_read (URLContext *h, uint8_t *buf, int size) | 
| static int64_t | http_seek_internal (URLContext *h, int64_t off, int whence, int force_reconnect) | 
| static int | http_read_stream (URLContext *h, uint8_t *buf, int size) | 
| static int | http_read_stream_all (URLContext *h, uint8_t *buf, int size) | 
| static void | update_metadata (URLContext *h, char *data) | 
| static int | store_icy (URLContext *h, int size) | 
| static int | http_read (URLContext *h, uint8_t *buf, int size) | 
| static int | http_write (URLContext *h, const uint8_t *buf, int size) | 
| static int | http_close (URLContext *h) | 
| static int64_t | http_seek (URLContext *h, int64_t off, int whence) | 
| static int | http_get_file_handle (URLContext *h) | 
| static int | http_get_short_seek (URLContext *h) | 
| Variables | |
| static const AVOption | options [] | 
| #define BUFFER_SIZE MAX_URL_SIZE | 
| #define OFFSET | ( | x | ) | offsetof(HTTPContext, x) | 
| #define D AV_OPT_FLAG_DECODING_PARAM | 
| #define E AV_OPT_FLAG_ENCODING_PARAM | 
| #define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) | 
| #define HTTP_CLASS | ( | flavor | ) | 
| enum HandshakeState | 
| 
 | static | 
Definition at line 1150 of file http.c.
Referenced by http_open_cnx_internal().
| 
 | static | 
Definition at line 1118 of file http.c.
Referenced by http_connect(), http_handshake(), and http_read_stream().
| 
 | static | 
Definition at line 1622 of file http.c.
Referenced by ff_http_do_new_request(), and http_close().
| 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.
| dest | URL context whose authentication state gets updated | 
| src | URL context whose authentication state gets copied | 
| 
 | static | 
Definition at line 190 of file http.c.
Referenced by http_open_cnx().
| 
 | static | 
Definition at line 252 of file http.c.
Referenced by ff_http_do_new_request(), http_open(), and http_seek_internal().
| int ff_http_do_new_request | ( | URLContext * | h, | 
| const char * | uri | ||
| ) | 
Send a new HTTP request, reusing the old connection.
| h | pointer to the resource | 
| uri | uri used to perform the request | 
Definition at line 308 of file http.c.
Referenced by dashenc_io_open(), hlsenc_io_open(), open_url_keepalive(), and rtmp_http_send_cmd().
Definition at line 359 of file http.c.
Referenced by check_http_code(), ff_rtsp_averror(), http_open_cnx(), and process_line().
| 
 | static | 
Definition at line 376 of file http.c.
Referenced by handle_http_errors(), and http_handshake().
| 
 | static | 
Definition at line 450 of file http.c.
Referenced by http_handshake().
| 
 | static | 
Definition at line 456 of file http.c.
Referenced by http_listen().
| 
 | static | 
Definition at line 492 of file http.c.
Referenced by http_open().
| 
 | static | 
| 
 | static | 
| 
 | static | 
Definition at line 588 of file http.c.
Referenced by http_get_line().
| 
 | static | 
Definition at line 605 of file http.c.
Referenced by http_buf_read(), and http_read_header().
| 
 | static | 
Definition at line 629 of file http.c.
Referenced by process_line().
| 
 | static | 
Definition at line 644 of file http.c.
Referenced by process_line().
| 
 | static | 
Definition at line 658 of file http.c.
Referenced by process_line().
| 
 | static | 
Definition at line 673 of file http.c.
Referenced by process_line().
| 
 | static | 
Definition at line 707 of file http.c.
Referenced by process_line().
| 
 | static | 
Definition at line 729 of file http.c.
Referenced by get_cookies(), and parse_cookie().
| 
 | static | 
Definition at line 754 of file http.c.
Referenced by get_cookies(), and parse_cookie().
| 
 | static | 
Definition at line 789 of file http.c.
Referenced by get_cookies(), and process_line().
| 
 | static | 
Definition at line 851 of file http.c.
Referenced by http_read_header().
| 
 | static | 
Definition at line 874 of file http.c.
Referenced by http_read_header().
| 
 | static | 
Create a string containing cookie values for use as a HTTP cookie header field value for a particular path and domain from the cookie values stored in the HTTP protocol context.
The cookie string is stored in *cookies, and may be NULL if there are no valid cookies.
Definition at line 1028 of file http.c.
Referenced by http_connect().
| 
 | inlinestatic | 
Definition at line 1110 of file http.c.
Referenced by http_connect().
| 
 | static | 
Definition at line 1337 of file http.c.
Referenced by http_read_stream().
| 
 | static | 
Definition at line 1671 of file http.c.
Referenced by http_read_stream(), and http_seek().
| 
 | static | 
Definition at line 1445 of file http.c.
Referenced by http_read(), and http_read_stream_all().
| 
 | static | 
Definition at line 1501 of file http.c.
Referenced by store_icy().
| 
 | static | 
Definition at line 1513 of file http.c.
Referenced by store_icy().
| 
 | static | 
Definition at line 1541 of file http.c.
Referenced by http_read().
| 
 | static | 
| 
 | static | 
| 
 | static | 
| 
 | static | 
| 
 | static | 
| 
 | static | 
| 
 | static | 
Definition at line 136 of file http.c.
Referenced by ff_http_do_new_request(), http_listen(), http_open(), http_open_cnx(), http_open_cnx_internal(), and http_seek_internal().
 1.8.17
 1.8.17