diff options
author | Måns Rullgård <mans@mansr.com> | 2010-03-08 18:43:27 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-03-08 18:43:27 +0000 |
commit | 22f73dccad7c43ea68eefd7d4ce9efff6c8f45c2 (patch) | |
tree | 33a3e9ed6b7252fb94eddd62e366b0091174fc90 /libavformat/os_support.c | |
parent | f19a068ef656ecc8303290d89769f1a1a288236e (diff) | |
download | ffmpeg-22f73dccad7c43ea68eefd7d4ce9efff6c8f45c2.tar.gz |
Move resolve_host() to ffserver.c
This deprecated function is only used by ffserver, yet does not have
a prototype visible there.
In the long term, ffserver should be made IPv6-aware. In the meantime,
this change removes cruft from lavf and fixes some warnings in ffserver.
Originally committed as revision 22329 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r-- | libavformat/os_support.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 4b8e16d681..27863031d1 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -223,41 +223,6 @@ const char *ff_gai_strerror(int ecode) } #endif -/* resolve host with also IP address parsing */ -int resolve_host(struct in_addr *sin_addr, const char *hostname) -{ - - if (!ff_inet_aton(hostname, sin_addr)) { -#if HAVE_GETADDRINFO - struct addrinfo *ai, *cur; - struct addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; - if (getaddrinfo(hostname, NULL, &hints, &ai)) - return -1; - /* getaddrinfo returns a linked list of addrinfo structs. - * Even if we set ai_family = AF_INET above, make sure - * that the returned one actually is of the correct type. */ - for (cur = ai; cur; cur = cur->ai_next) { - if (cur->ai_family == AF_INET) { - *sin_addr = ((struct sockaddr_in *)cur->ai_addr)->sin_addr; - freeaddrinfo(ai); - return 0; - } - } - freeaddrinfo(ai); - return -1; -#else - struct hostent *hp; - hp = gethostbyname(hostname); - if (!hp) - return -1; - memcpy(sin_addr, hp->h_addr_list[0], sizeof(struct in_addr)); -#endif - } - return 0; -} - int ff_socket_nonblock(int socket, int enable) { #if HAVE_WINSOCK2_H |