author | Michael Krelin <hacker@klever.net> | 2007-12-29 00:03:39 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-01-04 18:19:19 (UTC) |
commit | 7646173a571482e78c2c676f68988b6dcb457246 (patch) (side-by-side diff) | |
tree | 3891371d30969196f3ec3abfbc6a1c29d93fbbb1 | |
parent | f18a3be558f9df3267f6de4f5889cb16b420be98 (diff) | |
download | libopkele-7646173a571482e78c2c676f68988b6dcb457246.zip libopkele-7646173a571482e78c2c676f68988b6dcb457246.tar.gz libopkele-7646173a571482e78c2c676f68988b6dcb457246.tar.bz2 |
corrected typo
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | lib/util.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util.cc b/lib/util.cc index 4600576..e5ca62d 100644 --- a/lib/util.cc +++ b/lib/util.cc @@ -143,49 +143,49 @@ namespace opkele { string rv(t); curl_free(t); return rv; } string long_to_string(long l) { char rv[32]; int r=snprintf(rv,sizeof(rv),"%ld",l); if(r<0 || r>=(int)sizeof(rv)) throw failed_conversion(OPKELE_CP_ "failed to snprintf()"); return rv; } long string_to_long(const string& s) { char *endptr = 0; long rv = strtol(s.c_str(),&endptr,10); if((!endptr) || endptr==s.c_str()) throw failed_conversion(OPKELE_CP_ "failed to strtol()"); return rv; } /* * Normalize URL according to the rules, described in rfc 3986, section 6 * - * - uppercase hext triplets (e.g. %ab -> %AB) + * - uppercase hex triplets (e.g. %ab -> %AB) * - lowercase scheme and host * - decode %-encoded characters, specified as unreserved in rfc 3986, section 2.3, * that is - [:alpha:][:digit:]._~- * - remove dot segments * - remove empty and default ports * - if there's no path component, add '/' */ string rfc_3986_normalize_uri(const string& uri) { static const char *whitespace = " \t\r\n"; string rv; string::size_type ns = uri.find_first_not_of(whitespace); if(ns==string::npos) throw bad_input(OPKELE_CP_ "Can't normalize empty URI"); string::size_type colon = uri.find(':',ns); if(colon==string::npos) throw bad_input(OPKELE_CP_ "No scheme specified in URI"); transform( uri.begin()+ns, uri.begin()+colon+1, back_inserter(rv), ::tolower ); bool s; string::size_type ul = uri.find_last_not_of(whitespace)+1; if(ul <= (colon+3)) throw bad_input(OPKELE_CP_ "Unexpected end of URI being normalized encountered"); if(uri[colon+1]!='/' || uri[colon+2]!='/') |