]> git.sesse.net Git - vlc/commitdiff
Remove net_AddressIsMulticast:
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 24 Jan 2008 17:22:50 +0000 (17:22 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 24 Jan 2008 17:22:50 +0000 (17:22 +0000)
it did not work properly (proper check is impossible without blocking)

include/vlc_network.h
modules/gui/wxwidgets/dialogs/wizard.cpp

index 5e09fb298416292ce71796ff73468db956c1e8db..4fd7d5316e72bffe115729e1f2b2ececb3cd0a0f 100644 (file)
@@ -286,34 +286,6 @@ net_SockAddrIsMulticast (const struct sockaddr *addr, socklen_t len)
 }
 
 
-
-/**
- * net_AddressIsMulticast
- * @return VLC_FALSE iff the psz_addr does not specify a multicast address,
- * or the address is not a valid address.
- */
-static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, const char *psz_addr )
-{
-    struct addrinfo hints, *res;
-
-    memset (&hints, 0, sizeof (hints));
-    hints.ai_socktype = SOCK_DGRAM; /* UDP */
-    hints.ai_flags = AI_NUMERICHOST;
-
-    int i = vlc_getaddrinfo (p_object, psz_addr, 0,
-                             &hints, &res);
-    if (i)
-    {
-        msg_Err (p_object, "invalid address \"%s\" for net_AddressIsMulticast (%s)",
-                 psz_addr, vlc_gai_strerror (i));
-        return VLC_FALSE;
-    }
-
-    vlc_bool_t b = net_SockAddrIsMulticast (res->ai_addr, res->ai_addrlen);
-    vlc_freeaddrinfo (res);
-    return b;
-}
-
 static inline int net_GetSockAddress( int fd, char *address, int *port )
 {
     struct sockaddr_storage addr;
index 6ee53449be73db1a640e85771353a0ad6a038dbf..8b50ca61f1c77b8ed55831c20b254e793317467a 100644 (file)
@@ -1079,16 +1079,7 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event)
     if( !event.GetDirection() ) return;
 
     /* Check valid address */
-    if( i_method == 1
-     && !net_AddressIsMulticast( (vlc_object_t *)p_intf,
-                                 address_txtctrl->GetValue().mb_str(wxConvUTF8)) )
-    {
-        wxMessageBox( wxU( INVALID_MCAST_ADDRESS ) , wxU( ERROR_MSG ),
-                      wxICON_WARNING | wxOK, this->p_parent );
-        event.Veto();
-
-    }
-    else if( i_method == 0 && address_txtctrl->GetValue().IsEmpty() )
+    if( i_method == 0 && address_txtctrl->GetValue().IsEmpty() )
     {
         wxMessageBox( wxU( NO_ADDRESS_TEXT ) , wxU( ERROR_MSG ),
                       wxICON_WARNING | wxOK, this->p_parent );