Skip to content

Commit

Permalink
engine: network: rename length variable to something that makes sense…
Browse files Browse the repository at this point in the history
…. Add usage line to http_addcustomserver
  • Loading branch information
a1batross committed Nov 26, 2023
1 parent 7051b84 commit 4c3c352
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions engine/common/net_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand All @@ -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 );

Expand Down Expand Up @@ -2875,6 +2878,10 @@ static void HTTP_AddCustomServer_f( void )
{
HTTP_AddCustomServer( Cmd_Argv( 1 ));
}
else
{
Con_Printf( S_USAGE "http_addcustomserver <url>\n" );
}
}

/*
Expand Down

0 comments on commit 4c3c352

Please sign in to comment.