Browse Source

engine: network: make all HTTP commands and cvars restricted, except http_addcustomserver. Also zero http_useragent by default (it's autogenerated now)

pull/2/head
Alibek Omarov 2 years ago
parent
commit
c2992afb4a
  1. 20
      engine/common/net_ws.c

20
engine/common/net_ws.c

@ -3043,16 +3043,16 @@ void HTTP_Init( void )
http.first_file = http.last_file = NULL; http.first_file = http.last_file = NULL;
Cmd_AddRestrictedCommand("http_download", &HTTP_Download_f, "add file to download queue"); Cmd_AddRestrictedCommand( "http_download", HTTP_Download_f, "add file to download queue" );
Cmd_AddRestrictedCommand("http_skip", &HTTP_Skip_f, "skip current download server"); Cmd_AddRestrictedCommand( "http_skip", HTTP_Skip_f, "skip current download server" );
Cmd_AddRestrictedCommand("http_cancel", &HTTP_Cancel_f, "cancel current download"); Cmd_AddRestrictedCommand( "http_cancel", HTTP_Cancel_f, "cancel current download" );
Cmd_AddRestrictedCommand("http_clear", &HTTP_Clear_f, "cancel all downloads"); Cmd_AddRestrictedCommand( "http_clear", HTTP_Clear_f, "cancel all downloads" );
Cmd_AddCommand("http_list", &HTTP_List_f, "list all queued downloads"); Cmd_AddRestrictedCommand( "http_list", HTTP_List_f, "list all queued downloads" );
Cmd_AddCommand("http_addcustomserver", &HTTP_AddCustomServer_f, "add custom fastdl server"); Cmd_AddCommand( "http_addcustomserver", HTTP_AddCustomServer_f, "add custom fastdl server");
http_useragent = Cvar_Get( "http_useragent", "xash3d", FCVAR_ARCHIVE, "User-Agent string" ); http_useragent = Cvar_Get( "http_useragent", "", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "User-Agent string" );
http_autoremove = Cvar_Get( "http_autoremove", "1", FCVAR_ARCHIVE, "remove broken files" ); http_autoremove = Cvar_Get( "http_autoremove", "1", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "remove broken files" );
http_timeout = Cvar_Get( "http_timeout", "45", FCVAR_ARCHIVE, "timeout for http downloader" ); http_timeout = Cvar_Get( "http_timeout", "45", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "timeout for http downloader" );
http_maxconnections = Cvar_Get( "http_maxconnections", "4", FCVAR_ARCHIVE, "maximum http connection number" ); http_maxconnections = Cvar_Get( "http_maxconnections", "4", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "maximum http connection number" );
// Read servers from fastdl.txt // Read servers from fastdl.txt
line = serverfile = (char *)FS_LoadFile( "fastdl.txt", 0, false ); line = serverfile = (char *)FS_LoadFile( "fastdl.txt", 0, false );

Loading…
Cancel
Save