Commit 22f8e743 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix wrapper: use SOCK_STREAM rather than SOCK_DGRAM for TCP

parent ea351fa9
...@@ -216,7 +216,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, ...@@ -216,7 +216,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
{ {
net_Close (fd); net_Close (fd);
#if !defined(WIN32) && !defined(UNDER_CE) #if !defined(WIN32) && !defined(UNDER_CE)
fd = rootwrap_bind (ptr->ai_family, ptr->ai_socktype, fd = rootwrap_bind (ptr->ai_family, socktype,
protocol ?: ptr->ai_protocol, ptr->ai_addr, protocol ?: ptr->ai_protocol, ptr->ai_addr,
ptr->ai_addrlen); ptr->ai_addrlen);
if (fd != -1) if (fd != -1)
......
...@@ -145,7 +145,7 @@ int rootwrap_bind (int family, int socktype, int protocol, ...@@ -145,7 +145,7 @@ int rootwrap_bind (int family, int socktype, int protocol,
} }
memset (&ss, 0, sizeof (ss)); memset (&ss, 0, sizeof (ss));
memcpy (&ss, addr, alen > sizeof (ss) ? sizeof (ss) : alen); memcpy (&ss, addr, (alen > sizeof (ss)) ? sizeof (ss) : alen);
pthread_mutex_lock (&mutex); pthread_mutex_lock (&mutex);
if (send (sock, &ss, sizeof (ss), 0) != sizeof (ss)) if (send (sock, &ss, sizeof (ss), 0) != sizeof (ss))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment