Roxen.git
/
server
/
etc
/
test
/
tests
/
http
/
http_common.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/test/tests/http/http_common.pike:59:
} } #define EXIT(X) while(1){write("\n\n\nThe offending response header:\n%O\n\n" \ "Protocol: %O (%O)\n" \ "Return code: %d (%d)\n" \ "Response mapping: %O\n", \ headers,prot,expected_prot, \ code,expected_code,hd);exit((X));}
-
void
verify_headers( string headers, int content_length,
+
mapping
verify_headers( string headers, int content_length,
string expected_prot, int expected_code,
-
int want_last_modified
,
)
+
int want_last_modified )
{ array q = headers / "\r\n"; string prot; int code; string message; mapping hd = ([]); if( sscanf( q[0], "%s %d %s", prot, code, message ) != 3 ) EXIT( BADHEADERS ); if( prot != expected_prot ) EXIT( BADPROT ); if( code != expected_code ) EXIT( BADCODE );
Roxen.git/server/etc/test/tests/http/http_common.pike:86:
sscanf( header, "%s: %s", a, b ); hd[ lower_case( a ) ] = b; } if( !hd->date ) EXIT( NODATE ); if( !hd["content-length"] || (int)hd["content-length"] != content_length ) EXIT( BADLENGTH ); if( want_last_modified && !hd["last-modified"] ) EXIT( BADMODIFIED );
+
+
return hd;
}