Mercurial > libavformat.hg
annotate os_support.c @ 5766:a292ef47e2f9 libavformat
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
author | conrad |
---|---|
date | Sun, 07 Mar 2010 19:48:59 +0000 |
parents | de3bbecc27ad |
children | 9a9284a1cf7f |
rev | line source |
---|---|
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
1 /* |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
2 * Various utilities for ffmpeg system |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard |
1506 | 4 * copyright (c) 2002 Francois Revol |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
5 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
6 * This file is part of FFmpeg. |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
7 * |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
12 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
17 * |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1171
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
885
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
21 */ |
3722
68749aaea50f
ensure we get explicit definition of various _XOPEN_SOURCE functions we use
aurel
parents:
3039
diff
changeset
|
22 |
68749aaea50f
ensure we get explicit definition of various _XOPEN_SOURCE functions we use
aurel
parents:
3039
diff
changeset
|
23 /* needed by inet_aton() */ |
68749aaea50f
ensure we get explicit definition of various _XOPEN_SOURCE functions we use
aurel
parents:
3039
diff
changeset
|
24 #define _SVID_SOURCE |
68749aaea50f
ensure we get explicit definition of various _XOPEN_SOURCE functions we use
aurel
parents:
3039
diff
changeset
|
25 |
443
afbe3a5aae02
libavformat/os_support.c HAVE_LOCALTIME_R patch by ("Steven M. Schultz" <sms at 2BSD dot COM>)
michael
parents:
230
diff
changeset
|
26 #include "config.h" |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
27 #include "avformat.h" |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
28 #include <unistd.h> |
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
29 #include <fcntl.h> |
3732 | 30 #include <sys/time.h> |
2773 | 31 #include "os_support.h" |
1798
d1e61f4d02cd
MinGW patch by <koyama AT infocity DOT co DOT jp>, reworked. Removed placeholder for winsock.
mmu_man
parents:
1797
diff
changeset
|
32 |
4206 | 33 #if CONFIG_NETWORK |
34 #if !HAVE_POLL_H | |
35 #if HAVE_WINSOCK2_H | |
1798
d1e61f4d02cd
MinGW patch by <koyama AT infocity DOT co DOT jp>, reworked. Removed placeholder for winsock.
mmu_man
parents:
1797
diff
changeset
|
36 #include <winsock2.h> |
4206 | 37 #elif HAVE_SYS_SELECT_H |
1797 | 38 #include <sys/select.h> |
39 #endif | |
1798
d1e61f4d02cd
MinGW patch by <koyama AT infocity DOT co DOT jp>, reworked. Removed placeholder for winsock.
mmu_man
parents:
1797
diff
changeset
|
40 #endif |
230
9f4f4ca9f7b5
simpler strptime - added os_support.[ch] - moved localtime_r to os_support.c
bellard
parents:
diff
changeset
|
41 |
2050
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
42 #include "network.h" |
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
43 |
4206 | 44 #if !HAVE_INET_ATON |
1511
6d9dd5b5e764
MinGW compilation fix, inet_aton and #includes depend on networking support.
diego
parents:
1506
diff
changeset
|
45 #include <stdlib.h> |
6d9dd5b5e764
MinGW compilation fix, inet_aton and #includes depend on networking support.
diego
parents:
1506
diff
changeset
|
46 #include <strings.h> |
6d9dd5b5e764
MinGW compilation fix, inet_aton and #includes depend on networking support.
diego
parents:
1506
diff
changeset
|
47 |
5766
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
48 int ff_inet_aton (const char * str, struct in_addr * add) |
1506 | 49 { |
50 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; | |
51 | |
2271 | 52 if (sscanf(str, "%d.%d.%d.%d", &add1, &add2, &add3, &add4) != 4) |
53 return 0; | |
1506 | 54 |
2269
dfccc156e185
fix emulated inet_aton so that it fails for invalid addresses
benoit
parents:
2267
diff
changeset
|
55 if (!add1 || (add1|add2|add3|add4) > 255) return 0; |
dfccc156e185
fix emulated inet_aton so that it fails for invalid addresses
benoit
parents:
2267
diff
changeset
|
56 |
5505
166bc62c1d57
Currently, the replacement which is used if inet_aton isn't available,
rbultje
parents:
4206
diff
changeset
|
57 add->s_addr = htonl((add1 << 24) + (add2 << 16) + (add3 << 8) + add4); |
1506 | 58 |
59 return 1; | |
60 } | |
5766
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
61 #else |
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
62 int ff_inet_aton (const char * str, struct in_addr * add) |
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
63 { |
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
64 return inet_aton(str, add); |
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
65 } |
4206 | 66 #endif /* !HAVE_INET_ATON */ |
2050
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
67 |
5516
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
68 #if !HAVE_GETADDRINFO |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
69 int ff_getaddrinfo(const char *node, const char *service, |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
70 const struct addrinfo *hints, struct addrinfo **res) |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
71 { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
72 struct hostent *h = NULL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
73 struct addrinfo *ai; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
74 struct sockaddr_in *sin; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
75 |
5588
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
76 #if HAVE_WINSOCK2_H |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
77 int (WSAAPI *win_getaddrinfo)(const char *node, const char *service, |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
78 const struct addrinfo *hints, |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
79 struct addrinfo **res); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
80 HMODULE ws2mod = GetModuleHandle("ws2_32.dll"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
81 win_getaddrinfo = GetProcAddress(ws2mod, "getaddrinfo"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
82 if (win_getaddrinfo) |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
83 return win_getaddrinfo(node, service, hints, res); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
84 #endif |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
85 |
5730
de3bbecc27ad
Make our getaddrinfo implementation initialize "struct addrinfo" return
reimar
parents:
5638
diff
changeset
|
86 *res = NULL; |
5516
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
87 sin = av_mallocz(sizeof(struct sockaddr_in)); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
88 if (!sin) |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
89 return EAI_FAIL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
90 sin->sin_family = AF_INET; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
91 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
92 if (node) { |
5766
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
93 if (!ff_inet_aton(node, &sin->sin_addr)) { |
5516
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
94 if (hints && (hints->ai_flags & AI_NUMERICHOST)) { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
95 av_free(sin); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
96 return EAI_FAIL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
97 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
98 h = gethostbyname(node); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
99 if (!h) { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
100 av_free(sin); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
101 return EAI_FAIL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
102 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
103 memcpy(&sin->sin_addr, h->h_addr_list[0], sizeof(struct in_addr)); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
104 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
105 } else { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
106 if (hints && (hints->ai_flags & AI_PASSIVE)) { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
107 sin->sin_addr.s_addr = INADDR_ANY; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
108 } else |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
109 sin->sin_addr.s_addr = INADDR_LOOPBACK; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
110 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
111 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
112 /* Note: getaddrinfo allows service to be a string, which |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
113 * should be looked up using getservbyname. */ |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
114 if (service) |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
115 sin->sin_port = htons(atoi(service)); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
116 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
117 ai = av_mallocz(sizeof(struct addrinfo)); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
118 if (!ai) { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
119 av_free(sin); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
120 return EAI_FAIL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
121 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
122 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
123 *res = ai; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
124 ai->ai_family = AF_INET; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
125 ai->ai_socktype = hints ? hints->ai_socktype : 0; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
126 switch (ai->ai_socktype) { |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
127 case SOCK_STREAM: ai->ai_protocol = IPPROTO_TCP; break; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
128 case SOCK_DGRAM: ai->ai_protocol = IPPROTO_UDP; break; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
129 default: ai->ai_protocol = 0; break; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
130 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
131 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
132 ai->ai_addr = (struct sockaddr *)sin; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
133 ai->ai_addrlen = sizeof(struct sockaddr_in); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
134 if (hints && (hints->ai_flags & AI_CANONNAME)) |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
135 ai->ai_canonname = h ? av_strdup(h->h_name) : NULL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
136 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
137 ai->ai_next = NULL; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
138 return 0; |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
139 } |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
140 |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
141 void ff_freeaddrinfo(struct addrinfo *res) |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
142 { |
5588
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
143 #if HAVE_WINSOCK2_H |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
144 void (WSAAPI *win_freeaddrinfo)(struct addrinfo *res); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
145 HMODULE ws2mod = GetModuleHandle("ws2_32.dll"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
146 win_freeaddrinfo = (void (WSAAPI *)(struct addrinfo *res)) |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
147 GetProcAddress(ws2mod, "freeaddrinfo"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
148 if (win_freeaddrinfo) { |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
149 win_freeaddrinfo(res); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
150 return; |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
151 } |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
152 #endif |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
153 |
5516
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
154 av_free(res->ai_canonname); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
155 av_free(res->ai_addr); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
156 av_free(res); |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
157 } |
5520
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
158 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
159 int ff_getnameinfo(const struct sockaddr *sa, int salen, |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
160 char *host, int hostlen, |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
161 char *serv, int servlen, int flags) |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
162 { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
163 const struct sockaddr_in *sin = (const struct sockaddr_in *)sa; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
164 |
5588
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
165 #if HAVE_WINSOCK2_H |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
166 int (WSAAPI *win_getnameinfo)(const struct sockaddr *sa, socklen_t salen, |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
167 char *host, DWORD hostlen, |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
168 char *serv, DWORD servlen, int flags); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
169 HMODULE ws2mod = GetModuleHandle("ws2_32.dll"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
170 win_getnameinfo = GetProcAddress(ws2mod, "getnameinfo"); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
171 if (win_getnameinfo) |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
172 return win_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
173 #endif |
866c497d9abd
Load the proper getaddrinfo functions from ws2_32.dll, if they're present.
ramiro
parents:
5520
diff
changeset
|
174 |
5520
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
175 if (sa->sa_family != AF_INET) |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
176 return EAI_FAMILY; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
177 if (!host && !serv) |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
178 return EAI_NONAME; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
179 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
180 if (host && hostlen > 0) { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
181 struct hostent *ent = NULL; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
182 uint32_t a; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
183 if (!(flags & NI_NUMERICHOST)) |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
184 ent = gethostbyaddr((const char *)&sin->sin_addr, |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
185 sizeof(sin->sin_addr), AF_INET); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
186 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
187 if (ent) { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
188 snprintf(host, hostlen, "%s", ent->h_name); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
189 } else if (flags & NI_NAMERQD) { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
190 return EAI_NONAME; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
191 } else { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
192 a = ntohl(sin->sin_addr.s_addr); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
193 snprintf(host, hostlen, "%d.%d.%d.%d", |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
194 ((a >> 24) & 0xff), ((a >> 16) & 0xff), |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
195 ((a >> 8) & 0xff), ( a & 0xff)); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
196 } |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
197 } |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
198 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
199 if (serv && servlen > 0) { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
200 struct servent *ent = NULL; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
201 if (!(flags & NI_NUMERICSERV)) |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
202 ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp"); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
203 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
204 if (ent) { |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
205 snprintf(serv, servlen, "%s", ent->s_name); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
206 } else |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
207 snprintf(serv, servlen, "%d", ntohs(sin->sin_port)); |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
208 } |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
209 |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
210 return 0; |
8797851aeedb
Provide a fallback for getnameinfo() also. Patch by Martin Storsj«Ó
rbultje
parents:
5516
diff
changeset
|
211 } |
5638
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
212 |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
213 const char *ff_gai_strerror(int ecode) |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
214 { |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
215 switch(ecode) { |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
216 case EAI_FAIL : return "A non-recoverable error occurred"; |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
217 case EAI_FAMILY : return "The address family was not recognized or the address length was invalid for the specified family"; |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
218 case EAI_NONAME : return "The name does not resolve for the supplied parameters"; |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
219 } |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
220 |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
221 return "Unknown error"; |
a3e321e7ca38
Implement gai_strerror() for systems lacking such functionality. Patch
rbultje
parents:
5588
diff
changeset
|
222 } |
5516
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
223 #endif |
afe4a96b6832
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
rbultje
parents:
5515
diff
changeset
|
224 |
2050
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
225 /* resolve host with also IP address parsing */ |
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
226 int resolve_host(struct in_addr *sin_addr, const char *hostname) |
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
227 { |
2052 | 228 |
5766
a292ef47e2f9
Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
conrad
parents:
5730
diff
changeset
|
229 if (!ff_inet_aton(hostname, sin_addr)) { |
5515
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
230 #if HAVE_GETADDRINFO |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
231 struct addrinfo *ai, *cur; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
232 struct addrinfo hints; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
233 memset(&hints, 0, sizeof(hints)); |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
234 hints.ai_family = AF_INET; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
235 if (getaddrinfo(hostname, NULL, &hints, &ai)) |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
236 return -1; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
237 /* getaddrinfo returns a linked list of addrinfo structs. |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
238 * Even if we set ai_family = AF_INET above, make sure |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
239 * that the returned one actually is of the correct type. */ |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
240 for (cur = ai; cur; cur = cur->ai_next) { |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
241 if (cur->ai_family == AF_INET) { |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
242 *sin_addr = ((struct sockaddr_in *)cur->ai_addr)->sin_addr; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
243 freeaddrinfo(ai); |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
244 return 0; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
245 } |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
246 } |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
247 freeaddrinfo(ai); |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
248 return -1; |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
249 #else |
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
250 struct hostent *hp; |
2052 | 251 hp = gethostbyname(hostname); |
252 if (!hp) | |
253 return -1; | |
3723
81726233f9b3
use h_addr_list[0] instead of h_addr as this is the posix hostent field name
aurel
parents:
3722
diff
changeset
|
254 memcpy(sin_addr, hp->h_addr_list[0], sizeof(struct in_addr)); |
5515
fa3115c9b043
Use getaddrinfo(), if available, in resolve_host(). Patch by Martin
rbultje
parents:
5505
diff
changeset
|
255 #endif |
2050
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
256 } |
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
257 return 0; |
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
258 } |
2057
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
259 |
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
260 int ff_socket_nonblock(int socket, int enable) |
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
261 { |
4206 | 262 #if HAVE_WINSOCK2_H |
2085 | 263 return ioctlsocket(socket, FIONBIO, &enable); |
264 #else | |
2057
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
265 if (enable) |
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
266 return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK); |
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
267 else |
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
268 return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK); |
2085 | 269 #endif |
2057
857fbfeb2fa0
implement ff_socket_nonblock and use it in networking code
alex
parents:
2052
diff
changeset
|
270 } |
2050
612d19cb9550
move resolve_host from tcp.c to os_support.c as it is used widely
alex
parents:
2025
diff
changeset
|
271 #endif /* CONFIG_NETWORK */ |
1797 | 272 |
4206 | 273 #if CONFIG_FFSERVER |
274 #if !HAVE_POLL_H | |
1797 | 275 int poll(struct pollfd *fds, nfds_t numfds, int timeout) |
276 { | |
277 fd_set read_set; | |
278 fd_set write_set; | |
279 fd_set exception_set; | |
280 nfds_t i; | |
281 int n; | |
282 int rc; | |
283 | |
4206 | 284 #if HAVE_WINSOCK2_H |
2092 | 285 if (numfds >= FD_SETSIZE) { |
286 errno = EINVAL; | |
287 return -1; | |
288 } | |
2093 | 289 #endif |
2092 | 290 |
1797 | 291 FD_ZERO(&read_set); |
292 FD_ZERO(&write_set); | |
293 FD_ZERO(&exception_set); | |
294 | |
295 n = -1; | |
296 for(i = 0; i < numfds; i++) { | |
297 if (fds[i].fd < 0) | |
298 continue; | |
4206 | 299 #if !HAVE_WINSOCK2_H |
2093 | 300 if (fds[i].fd >= FD_SETSIZE) { |
301 errno = EINVAL; | |
302 return -1; | |
303 } | |
304 #endif | |
1797 | 305 |
306 if (fds[i].events & POLLIN) FD_SET(fds[i].fd, &read_set); | |
307 if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, &write_set); | |
308 if (fds[i].events & POLLERR) FD_SET(fds[i].fd, &exception_set); | |
309 | |
310 if (fds[i].fd > n) | |
311 n = fds[i].fd; | |
312 }; | |
313 | |
314 if (n == -1) | |
315 /* Hey!? Nothing to poll, in fact!!! */ | |
316 return 0; | |
317 | |
318 if (timeout < 0) | |
319 rc = select(n+1, &read_set, &write_set, &exception_set, NULL); | |
320 else { | |
321 struct timeval tv; | |
322 | |
323 tv.tv_sec = timeout / 1000; | |
324 tv.tv_usec = 1000 * (timeout % 1000); | |
325 rc = select(n+1, &read_set, &write_set, &exception_set, &tv); | |
326 }; | |
327 | |
328 if (rc < 0) | |
329 return rc; | |
330 | |
331 for(i = 0; i < (nfds_t) n; i++) { | |
332 fds[i].revents = 0; | |
333 | |
334 if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN; | |
335 if (FD_ISSET(fds[i].fd, &write_set)) fds[i].revents |= POLLOUT; | |
336 if (FD_ISSET(fds[i].fd, &exception_set)) fds[i].revents |= POLLERR; | |
337 }; | |
338 | |
339 return rc; | |
340 } | |
3039 | 341 #endif /* HAVE_POLL_H */ |
1799
0dc3a767943d
Make sure we don't try to emulate poll() when it's there if --disable-ffserver... 10l
mmu_man
parents:
1798
diff
changeset
|
342 #endif /* CONFIG_FFSERVER */ |
1797 | 343 |