mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-26 23:04:21 +00:00
engine: network: rename length variable to something that makes sense. Add usage line to http_addcustomserver
This commit is contained in:
parent
7051b844ff
commit
4c3c3529e9
@ -2411,7 +2411,7 @@ static qboolean HTTP_ProcessStream( httpfile_t *curfile )
|
||||
if( begin ) // Got full header
|
||||
{
|
||||
int cutheadersize = begin - curfile->buf + 4; // after that begin of data
|
||||
char *length;
|
||||
char *content_length_line;
|
||||
|
||||
Con_Reportf( "HTTP: Got response!\n" );
|
||||
|
||||
@ -2430,10 +2430,13 @@ static qboolean HTTP_ProcessStream( httpfile_t *curfile )
|
||||
}
|
||||
|
||||
// print size
|
||||
length = Q_stristr( curfile->buf, "Content-Length: " );
|
||||
if( length )
|
||||
content_length_line = Q_stristr( curfile->buf, "Content-Length: " );
|
||||
if( content_length_line )
|
||||
{
|
||||
int size = Q_atoi( length += 16 );
|
||||
int size;
|
||||
|
||||
content_length_line += sizeof( "Content-Length: " ) - 1;
|
||||
size = Q_atoi( content_length_line );
|
||||
|
||||
Con_Reportf( "HTTP: File size is %d\n", size );
|
||||
|
||||
@ -2875,6 +2878,10 @@ static void HTTP_AddCustomServer_f( void )
|
||||
{
|
||||
HTTP_AddCustomServer( Cmd_Argv( 1 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Printf( S_USAGE "http_addcustomserver <url>\n" );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user