30 #if CONFIG_TLS_OPENSSL_PROTOCOL 33 #if CONFIG_TLS_GNUTLS_PROTOCOL 40 #if CONFIG_TLS_OPENSSL_PROTOCOL 43 #if CONFIG_TLS_GNUTLS_PROTOCOL 58 "network initialization. Please use " 59 "avformat_network_init(), this will " 60 "become mandatory later.\n");
62 if (WSAStartup(MAKEWORD(1,1), &wsaData))
70 int ev = write ? POLLOUT : POLLIN;
71 struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
73 ret = poll(&p, 1, 100);
74 return ret < 0 ?
ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 :
AVERROR(EAGAIN);
87 int err = WSAGetLastError();
93 case WSAEPROTONOSUPPORT:
94 return AVERROR(EPROTONOSUPPORT);
108 if (addr->sa_family == AF_INET) {
109 return IN_MULTICAST(ntohl(((
struct sockaddr_in *)addr)->sin_addr.s_addr));
111 #if HAVE_STRUCT_SOCKADDR_IN6 112 if (addr->sa_family == AF_INET6) {
132 }
while (timeout < 0 || runs-- > 0);
146 fd = socket(af, type | SOCK_CLOEXEC, proto);
147 if (fd == -1 && errno == EINVAL)
150 fd = socket(af, type, proto);
153 fcntl(fd, F_SETFD, FD_CLOEXEC);
158 setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(
int){1},
sizeof(int));
164 socklen_t addrlen,
int timeout,
URLContext *h)
168 struct pollfd lp = { fd, POLLIN, 0 };
169 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse,
sizeof(reuse));
170 ret = bind(fd, addr, addrlen);
193 socklen_t addrlen,
int timeout,
URLContext *h,
196 struct pollfd p = {fd, POLLOUT, 0};
202 while ((ret = connect(fd, addr, addrlen))) {
214 optlen =
sizeof(ret);
215 if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen))
223 "Connection to %s failed (%s), trying next address\n",
239 if (!strcmp(pattern,
"*"))
242 if (pattern[0] ==
'*')
244 if (pattern[0] ==
'.')
246 len_p = strlen(pattern);
247 len_h = strlen(hostname);
251 if (!strcmp(pattern, &hostname[len_h - len_p])) {
254 if (hostname[len_h - len_p - 1] ==
'.')
273 char *sep, *next =
NULL;
274 start += strspn(start,
" ,");
275 sep = start + strcspn(start,
" ,");
#define AV_LOG_WARNING
Something somehow does not look correct.
memory handling functions
static int match_host_pattern(const char *pattern, const char *hostname)
AVIOInterruptCB interrupt_callback
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
void ff_network_close(void)
static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout, AVIOInterruptCB *cb)
int ff_socket(int af, int type, int proto)
int ff_network_inited_globally
#define IN6_IS_ADDR_MULTICAST(a)
int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h)
Bind to a file descriptor and poll for a connection.
int ff_network_init(void)
void ff_gnutls_init(void)
int ff_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h, int will_try_next)
Connect to a file descriptor and poll for result.
Callback for checking whether to abort blocking functions.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int ff_is_multicast_address(struct sockaddr *addr)
int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
void ff_openssl_init(void)
int ff_socket_nonblock(int socket, int enable)
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
int ff_check_interrupt(AVIOInterruptCB *cb)
Check if the user has requested to interrupt a blocking function associated with cb.
char * av_strdup(const char *s)
Duplicate the string s.
void ff_gnutls_deinit(void)
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
common internal api header.
char * filename
specified URL
int ff_network_wait_fd(int fd, int write)
void ff_openssl_deinit(void)
unbuffered private I/O API