39 if (!hostname || hostname_size <= 0)
58 char buf[200],
opts[50] =
"";
59 const char *proxy_path;
60 char *env_http_proxy, *env_no_proxy;
71 if (
c->listen && !
c->is_dtls)
85 ff_url_join(buf,
sizeof(buf),
c->is_dtls ?
"udp" :
"tcp",
NULL, (
c->is_dtls &&
c->listen) ?
"" :
c->underlying_host, port,
"%s", p);
88 proxy_path =
c->http_proxy ?
c->http_proxy : env_http_proxy;
95 if (!
c->is_dtls && use_proxy) {
96 char proxy_host[200], proxy_auth[200], dest[200];
99 proxy_host,
sizeof(proxy_host), &proxy_port,
NULL, 0,
102 ff_url_join(buf,
sizeof(buf),
"httpproxy", proxy_auth, proxy_host,
103 proxy_port,
"/%s", dest);
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
#define AVIO_FLAG_READ
read-only
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
void av_bprintf(AVBPrint *buf, const char *fmt,...)
static char * getenv_utf8(const char *varname)
static void freeenv_utf8(char *var)
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
Memory handling functions.
int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
miscellaneous OS support macros and functions.
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)
Attempt to find a specific tag in a URL.
const char * protocol_whitelist
AVIOInterruptCB interrupt_callback
const char * protocol_blacklist
static AVDictionary * opts
int ff_url_read_all(const char *url, AVBPrint *bp)
Read all data from the given URL url and store it in the given buffer bp.
int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options)
int ff_tls_parse_host(TLSShared *s, char *hostname, int hostname_size, int *port_ptr, const char *uri)
int ff_is_dtls_packet(const uint8_t *buf, int size)
Whether the packet is a DTLS packet, as defined by RFC 5764 Section 5.1.2.
#define DTLS_RECORD_LAYER_HEADER_LEN
The DTLS record layer header has a total size of 13 bytes, consisting of ContentType (1 byte),...
#define DTLS_VERSION_10
The DTLS version number, which is 0xfeff for DTLS 1.0, or 0xfefd for DTLS 1.2.
#define DTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC
The DTLS content type.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
unbuffered private I/O API
static int ffurl_read(URLContext *h, uint8_t *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.