*****************************************************************************/
#define LISTEN_BACKLOG 100
-#if defined(HAVE_GETNAMEINFO) && !defined(HAVE_GETADDRINFO)
-/*
- * For now, VLC's configure script does not check for getaddrinfo(),
- * but it should be present if getnameinfo() is (the opposite is untrue, with
- * Debian potato as an example)
- */
-# define HAVE_GETADDRINFO 1
-#endif
-
static void httpd_HostThread( httpd_host_t * );
static int GetAddrPort( const struct sockaddr_storage *p_ss );
return host;
error:
+ if( httpd->i_host <= 0 )
+ {
+ vlc_object_release( httpd );
+ vlc_object_detach( httpd );
+ vlc_object_destroy( httpd );
+ }
vlc_mutex_unlock( lockval.p_address );
if( fd != -1 )
vlc_object_destroy( host );
}
- /* TODO destroy no more used httpd TODO */
- vlc_object_release( httpd );
return NULL;
}
var_Get( httpd->p_libvlc, "httpd_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
- vlc_object_release( httpd );
-
host->i_ref--;
if( host->i_ref > 0 )
{
if( httpd->i_host <= 0 )
{
msg_Info( httpd, "httpd doesn't reference any host, deleting" );
+ vlc_object_release( httpd );
vlc_object_detach( httpd );
vlc_object_destroy( httpd );
}
if( cl->i_buffer >= 4 )
{
- fprintf( stderr, "peek=%4.4s\n", cl->p_buffer );
+ /*fprintf( stderr, "peek=%4.4s\n", cl->p_buffer );*/
/* detect type */
if( cl->p_buffer[0] == '$' )
{
p = NULL;
cl->query.i_type = HTTPD_MSG_NONE;
- fprintf( stderr, "received new request=%s\n", cl->p_buffer);
+ /*fprintf( stderr, "received new request=%s\n", cl->p_buffer);*/
for( i = 0; msg_type[i].name != NULL; i++ )
{
cl->i_activity_timeout = 0;
/* Debugging only */
- if( cl->i_state == HTTPD_CLIENT_RECEIVE_DONE )
+ /*if( cl->i_state == HTTPD_CLIENT_RECEIVE_DONE )
{
int i;
fprintf( stderr, " - option name='%s' value='%s'\n",
cl->query.name[i], cl->query.value[i] );
}
- }
+ }*/
}
cl->i_buffer = 0;
cl->i_buffer_size = (uint8_t*)p - cl->p_buffer;
- fprintf( stderr, "sending answer\n" );
- fprintf( stderr, "%s", cl->p_buffer );
+ /*fprintf( stderr, "sending answer\n" );
+ fprintf( stderr, "%s", cl->p_buffer );*/
}
i_len = httpd_NetSend( cl, &cl->p_buffer[cl->i_buffer],