]> git.sesse.net Git - vlc/blobdiff - src/network/httpd.c
Extend libvlc Media Player API for DVD menu navigation
[vlc] / src / network / httpd.c
index 8dbdbf5878edecdd480432d46d9c71b2d6e8e0ab..2e95eedc38ffd0d352de06c6e87bc50101db38dc 100644 (file)
@@ -2144,7 +2144,7 @@ static void* httpd_HostThread( void *data )
                     answer->i_body = 0;
                     answer->p_body = NULL;
 
-                    httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
+                    httpd_MsgAdd( answer, "Server", "VLC/%s", VERSION );
                     httpd_MsgAdd( answer, "Content-Length", "0" );
 
                     switch( query->i_proto )
@@ -2515,15 +2515,12 @@ static void* httpd_HostThread( void *data )
                 continue;
 
             /* */
-#ifdef HAVE_ACCEPT4
-            fd = accept4 (fd, NULL, NULL, SOCK_CLOEXEC);
-            if (fd == -1 && errno == ENOSYS)
-#endif
-            fd = accept (fd, NULL, NULL);
+            fd = vlc_accept (fd, NULL, NULL, true);
             if (fd == -1)
                 continue;
+            setsockopt (fd, SOL_SOCKET, SO_REUSEADDR,
+                        &(int){ 1 }, sizeof(int));
 
-            net_SetupSocket (fd);
             if( p_tls != NULL )
             {
                 switch( tls_ServerSessionHandshake( p_tls, fd ) )