1
0
mirror of git://erdgeist.org/opentracker synced 2025-04-08 14:16:53 +08:00

Some clients even send plain : in their requests

This commit is contained in:
erdgeist 2007-03-03 02:10:52 +00:00
parent a73186988f
commit f1359eb652

@ -11,11 +11,11 @@
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
we add '%' to the matrix to not stop at encoded chars. we add '%' to the matrix to not stop at encoded chars.
After losing too many requests to being too strict, add the following characters to reserved matrix After losing too many requests to being too strict, add the following characters to reserved matrix
relax = "+" | "," | "/" | ";" | "<" | ">" relax = "+" | "," | "/" | ";" | "<" | ">" | ":"
static const unsigned char reserved_matrix_strict[] = { 0xA2, 0x67, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; static const unsigned char reserved_matrix_strict[] = { 0xA2, 0x67, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47};
*/ */
static const unsigned char reserved_matrix[] = { 0xA2, 0xFF, 0xFF, 0x5B, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; static const unsigned char reserved_matrix[] = { 0xA2, 0xFF, 0xFF, 0x5F, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47};
static int is_unreserved( unsigned char c ) { static int is_unreserved( unsigned char c ) {
if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7));