57 return TLS_WANT_POLLIN;
60 return ret >= 0 ? ret : -1;
68 return TLS_WANT_POLLOUT;
71 return ret >= 0 ? ret : -1;
78 struct tls_config *cfg =
NULL;
81 if (tls_init() == -1) {
89 p->
ctx = !c->
listen ? tls_client() : tls_server();
95 cfg = tls_config_new();
100 if (tls_config_set_protocols(cfg, TLS_PROTOCOLS_ALL) == -1)
104 if (tls_config_set_ciphers(cfg,
"compat") == -1)
113 tls_config_insecure_noverifycert(cfg);
114 tls_config_insecure_noverifyname(cfg);
115 tls_config_insecure_noverifytime(cfg);
117 if (tls_configure(p->
ctx, cfg) == -1)
136 tls_config_free(cfg);
148 tls_config_free(cfg);
206 .priv_data_class = &tls_class,
#define URL_PROTOCOL_FLAG_NETWORK
#define LIBAVUTIL_VERSION_INT
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
const char * av_default_item_name(void *ptr)
Return the context name.
Convenience header that includes libavutil's core.
static int ff_tls_read(URLContext *h, uint8_t *buf, int size)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static const AVOption options[]
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int tls_read(URLContext *h, uint8_t *buf, int size)
static ssize_t tls_read_callback(struct tls *ctx, void *buf, size_t buflen, void *cb_arg)
#define TLS_COMMON_OPTIONS(pstruct, options_field)
static int tls_close(URLContext *h)
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
const URLProtocol ff_tls_protocol
static int tls_get_file_handle(URLContext *h)
Describe the class of an AVClass context structure.
static int ff_tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
int ffurl_close(URLContext *h)
static ssize_t tls_write_callback(struct tls *ctx, const void *buf, size_t buflen, void *cb_arg)
common internal api header.
int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options)
static const AVClass tls_class
static int ff_tls_write(URLContext *h, const uint8_t *buf, int size)
static int tls_write(URLContext *h, const uint8_t *buf, int size)
unbuffered private I/O API
static int ff_tls_close(URLContext *h)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf...