48 if (!*path)
return AVERROR(EINVAL);
52 path = strchr(path,
'/');
53 if (!path)
return AVERROR(EINVAL);
57 "Gopher protocol type '%c' not supported yet!\n",
81 char proto[10], hostname[1024], auth[1024], path[1024], buf[1024];
83 const char *lower_proto =
"tcp";
89 hostname,
sizeof(hostname), &port, path,
sizeof(path), uri);
94 if (!strcmp(proto,
"gophers"))
101 &
h->interrupt_callback,
NULL,
h->protocol_whitelist,
h->protocol_blacklist,
h);
120 #if CONFIG_GOPHER_PROTOCOL
129 .default_whitelist =
"gopher,tcp"
133 #if CONFIG_GOPHERS_PROTOCOL
142 .default_whitelist =
"gopher,gophers,tcp,tls"
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.
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.
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
#define flags(name, subs,...)
static int gopher_read(URLContext *h, uint8_t *buf, int size)
static int gopher_close(URLContext *h)
static int gopher_open(URLContext *h, const char *uri, int flags)
static int gopher_connect(URLContext *h, const char *path)
static int gopher_write(URLContext *h, const uint8_t *buf, int size)
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.
#define AV_LOG_WARNING
Something somehow does not look correct.
common internal API header
const URLProtocol ff_gophers_protocol
const URLProtocol ff_gopher_protocol
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
#define URL_PROTOCOL_FLAG_NETWORK