Commit e8955e0d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

http: fix parsing of HTTP CONNECT response

The major version must be one, and the error code must be successfully
extracted.
parent df3ede47
......@@ -996,7 +996,7 @@ static int Connect( access_t *p_access, uint64_t i_tell )
if( p_sys->b_proxy )
{
char *psz;
unsigned i_status = 0;
unsigned i_status;
if( p_sys->i_version == 0 )
{
......@@ -1018,7 +1018,8 @@ static int Connect( access_t *p_access, uint64_t i_tell )
return -1;
}
sscanf( psz, "HTTP/%*u.%*u %3u", &i_status );
if( sscanf( psz, "HTTP/1.%*u %3u", &i_status ) != 1 )
i_status = 0;
free( psz );
if( ( i_status / 100 ) != 2 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment