[vlc-commits] commit: win32: hack to fix some issues about listening on port (telnet, httpd) ( Rémi Duraffort )

git at videolan.org git at videolan.org
Thu Apr 29 17:32:05 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Apr 29 17:30:31 2010 +0200| [50a553fdb2a5360f0722e8ef8ed82b3e57ac1aa4] | committer: Rémi Duraffort 

win32: hack to fix some issues about listening on port (telnet, httpd)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=50a553fdb2a5360f0722e8ef8ed82b3e57ac1aa4
---

 src/network/io.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/network/io.c b/src/network/io.c
index bb9dc08..664c867 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -133,6 +133,23 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
 
     memset (&hints, 0, sizeof( hints ));
     hints.ai_protocol = protocol;
+
+#ifdef WIN32
+    /*
+     * ! HACK !
+     * Win32 seems to have some issues when the socket type is not defined.
+     * As a hack we define it according to the protocol
+     */
+    switch(protocol)
+    {
+    case IPPROTO_TCP:
+        hints.ai_socktype = SOCK_STREAM;
+        break;
+    case IPPROTO_UDP:
+        hints.ai_socktype = SOCK_DGRAM;
+        break;
+    }
+#endif
     hints.ai_flags = AI_PASSIVE;
 
     msg_Dbg (p_this, "net: listening to %s port %d", psz_host, i_port);



More information about the vlc-commits mailing list