From: RĂ©mi Denis-Courmont Date: Thu, 24 Jan 2008 17:22:50 +0000 (+0000) Subject: Remove net_AddressIsMulticast: X-Git-Tag: 0.9.0-test0~3230 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9b91b0136951cde2f9b19c49564e249c07a3252f;p=vlc Remove net_AddressIsMulticast: it did not work properly (proper check is impossible without blocking) --- diff --git a/include/vlc_network.h b/include/vlc_network.h index 5e09fb2984..4fd7d5316e 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -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; diff --git a/modules/gui/wxwidgets/dialogs/wizard.cpp b/modules/gui/wxwidgets/dialogs/wizard.cpp index 6ee53449be..8b50ca61f1 100644 --- a/modules/gui/wxwidgets/dialogs/wizard.cpp +++ b/modules/gui/wxwidgets/dialogs/wizard.cpp @@ -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 );