/***************************************************************************** * HTTPClose: Stop the internal HTTP server *****************************************************************************/ void E_(HTTPClose)( access_t *p_access ) { access_sys_t *p_sys = p_access->p_sys; if ( p_sys->p_httpd_host != NULL ) { if ( p_sys->p_httpd_file != NULL ) { /* Unlock the thread if it is stuck in HttpCallback */ vlc_mutex_lock( &p_sys->httpd_mutex ); if ( p_sys->b_request_frontend_info == VLC_TRUE ) { p_sys->b_request_frontend_info = VLC_FALSE; p_sys->psz_frontend_info = strdup(""); } if ( p_sys->b_request_mmi_info == VLC_TRUE ) { p_sys->b_request_mmi_info = VLC_FALSE; p_sys->psz_mmi_info = strdup(""); } vlc_cond_signal( &p_sys->httpd_cond ); vlc_mutex_unlock( &p_sys->httpd_mutex ); httpd_FileDelete( p_sys->p_httpd_file->p_file ); httpd_RedirectDelete( p_sys->p_httpd_redir ); } httpd_HostDelete( p_sys->p_httpd_host ); } vlc_mutex_destroy( &p_sys->httpd_mutex ); vlc_cond_destroy( &p_sys->httpd_cond ); }
/***************************************************************************** * Close: destroy interface *****************************************************************************/ static void Close ( vlc_object_t *p_this ) { intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys = p_intf->p_sys; int i; httpd_handler_sys_t *p_art_handler_sys = NULL; #ifdef ENABLE_VLM if( p_sys->p_vlm ) vlm_Delete( p_sys->p_vlm ); #endif for( i = 0; i < p_sys->i_files; i++ ) { if( p_sys->pp_files[i]->b_handler ) httpd_HandlerDelete( ((httpd_handler_sys_t *)p_sys->pp_files[i])->p_handler ); else httpd_FileDelete( p_sys->pp_files[i]->p_file ); if( p_sys->pp_files[i]->p_redir ) httpd_RedirectDelete( p_sys->pp_files[i]->p_redir ); if( p_sys->pp_files[i]->p_redir2 ) httpd_RedirectDelete( p_sys->pp_files[i]->p_redir2 ); free( p_sys->pp_files[i]->file ); free( p_sys->pp_files[i]->name ); free( p_sys->pp_files[i] ); } free( p_sys->pp_files ); for( i = 0; i < p_sys->i_handlers; i++ ) { http_association_t *p_handler = p_sys->pp_handlers[i]; int j; free( p_handler->psz_ext ); for( j = 0; j < p_handler->i_argc; j++ ) free( p_handler->ppsz_argv[j] ); if( p_handler->i_argc ) free( p_handler->ppsz_argv ); free( p_handler ); } if( p_sys->i_handlers ) free( p_sys->pp_handlers ); if( p_sys->p_art_handler ) p_art_handler_sys = httpd_HandlerDelete( p_sys->p_art_handler ); httpd_HostDelete( p_sys->p_httpd_host ); free( p_sys->psz_address ); free( p_sys ); free( p_art_handler_sys ); }
static int vlclua_httpd_redirect_delete( lua_State *L ) { httpd_redirect_t **pp_redirect = (httpd_redirect_t**)luaL_checkudata( L, 1, "httpd_redirect" ); httpd_RedirectDelete( *pp_redirect ); return 0; }