]> git.sesse.net Git - vlc/blobdiff - src/network/tcp.c
HTTPd: do not reveal the username through as the realm (fixes: #2993)
[vlc] / src / network / tcp.c
index 4f9fa36ad9aef186b708963ee219527342b1c25c..537c4f919bf96281458d6e3f28962963d9f1f73f 100644 (file)
@@ -153,8 +153,9 @@ int __net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
 
     for( ptr = res; ptr != NULL; ptr = ptr->ai_next )
     {
-        int fd = net_Socket( p_this, ptr->ai_family, type ?: ptr->ai_socktype,
-                             proto ?: ptr->ai_protocol );
+        int fd = net_Socket( p_this, ptr->ai_family,
+                             type ? type : ptr->ai_socktype,
+                             proto ? proto : ptr->ai_protocol );
         if( fd == -1 )
         {
             msg_Dbg( p_this, "socket error: %m" );
@@ -297,10 +298,8 @@ int __net_Accept( vlc_object_t *p_this, int *pi_fd, mtime_t i_wait )
             ufd[i].events = POLLIN;
             ufd[i].revents = 0;
         }
-        if (evfd == -1)
-            n--; /* avoid EBADF */
 
-        switch (poll (ufd, n, timeout))
+        switch (poll (ufd, n + (evfd != -1), timeout))
         {
             case -1:
                 if (net_errno == EINTR)
@@ -423,7 +422,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
             msg_Err( p_obj, "socks: unsupported authentication method %x",
                      buffer[0] );
         else
-            msg_Err( p_obj, "socks: authentification needed" );
+            msg_Err( p_obj, "socks: authentication needed" );
         return VLC_EGENERIC;
     }
 
@@ -513,7 +512,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
 
         if( buffer[1] != 0x00 )
         {
-            msg_Err( p_obj, "socks: CONNECT request failed\n" );
+            msg_Err( p_obj, "socks: CONNECT request failed" );
             return VLC_EGENERIC;
         }