summaryrefslogtreecommitdiff
path: root/tests/server/rtspd.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-19 19:20:38 +0100
committerYang Tse <yangsita@gmail.com>2010-11-19 19:20:38 +0100
commita768e39b2d6bd60cbf71e983f1003b22603cb71e (patch)
treee2537d2c144fbff6075499ef0bdc3eb9abd42bd1 /tests/server/rtspd.c
parent1c4fa240bec959fd23f4826d9aa9e624fa48d01a (diff)
downloadcurl-a768e39b2d6bd60cbf71e983f1003b22603cb71e.tar.gz
test servers: fix strict aliasing compiler warnings
Diffstat (limited to 'tests/server/rtspd.c')
-rw-r--r--tests/server/rtspd.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
index 788d61c36..d2471b998 100644
--- a/tests/server/rtspd.c
+++ b/tests/server/rtspd.c
@@ -58,6 +58,7 @@
#include "curlx.h" /* from the private lib dir */
#include "getpart.h"
#include "util.h"
+#include "server_sockaddr.h"
/* include memdebug.h last */
#include "memdebug.h"
@@ -1169,10 +1170,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
int main(int argc, char *argv[])
{
- struct sockaddr_in me;
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 me6;
-#endif /* ENABLE_IPV6 */
+ srvr_sockaddr_union_t me;
curl_socket_t sock = CURL_SOCKET_BAD;
curl_socket_t msgsock = CURL_SOCKET_BAD;
int wrotepidfile = 0;
@@ -1294,19 +1292,19 @@ int main(int argc, char *argv[])
#ifdef ENABLE_IPV6
if(!use_ipv6) {
#endif
- memset(&me, 0, sizeof(me));
- me.sin_family = AF_INET;
- me.sin_addr.s_addr = INADDR_ANY;
- me.sin_port = htons(port);
- rc = bind(sock, (struct sockaddr *) &me, sizeof(me));
+ memset(&me.sa4, 0, sizeof(me.sa4));
+ me.sa4.sin_family = AF_INET;
+ me.sa4.sin_addr.s_addr = INADDR_ANY;
+ me.sa4.sin_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa4));
#ifdef ENABLE_IPV6
}
else {
- memset(&me6, 0, sizeof(me6));
- me6.sin6_family = AF_INET6;
- me6.sin6_addr = in6addr_any;
- me6.sin6_port = htons(port);
- rc = bind(sock, (struct sockaddr *) &me6, sizeof(me6));
+ memset(&me.sa6, 0, sizeof(me.sa6));
+ me.sa6.sin6_family = AF_INET6;
+ me.sa6.sin6_addr = in6addr_any;
+ me.sa6.sin6_port = htons(port);
+ rc = bind(sock, &me.sa, sizeof(me.sa6));
}
#endif /* ENABLE_IPV6 */
if(0 != rc) {