diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 13a99ffa98..cb23ab2f0b 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Feb 11 10:45:40 CST 2009 +Wed Feb 11 10:46:12 CST 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c b/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c index f93adf7d16..2cfcd94a56 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c +++ b/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c @@ -42,6 +42,7 @@ #define MSG_HDR_T union http_header_u #include +#include #include #include @@ -52,7 +53,6 @@ #include #include -#include #include #include #include @@ -446,7 +446,7 @@ issize_t http_content_range_d(su_home_t *home, http_header_t *h, char *s, isize_ { http_content_range_t *cr = h->sh_content_range; - if (strncasecmp(s, "bytes", 5)) + if (!su_casenmatch(s, "bytes", 5)) return -1; s += 5; skip_lws(&s); if (s[0] == '*') { @@ -820,7 +820,7 @@ issize_t http_if_range_d(su_home_t *home, http_header_t *h, char *s, isize_t sle { http_if_range_t *ifr = (http_if_range_t *)h; - if (s[0] == '"' || strncasecmp(s, "W/\"", 3) == 0) { + if (s[0] == '"' || su_casenmatch(s, "W/\"", 3)) { ifr->ifr_tag = s; return 0; } else { diff --git a/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c b/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c index 898ed3a0c8..ff6bef2caa 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c +++ b/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c @@ -33,12 +33,7 @@ #include "config.h" -#include -#include -#include -#include -#include -#include +#include /* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */ #define MSG_PUB_T struct http_s @@ -46,6 +41,12 @@ #include "sofia-sip/http_parser.h" +#include +#include +#include +#include +#include + /* ========================================================================== */ /**@HTTP_HEADER http_proxy_connection Proxy-Connection extension header. */ @@ -348,7 +349,7 @@ static issize_t set_cookie_scanner(char *s) char *rest; #define LOOKING_AT(s, what) \ - (strncasecmp((s), what, strlen(what)) == 0 && (rest = s + strlen(what))) + (su_casenmatch((s), what, strlen(what)) && (rest = s + strlen(what))) /* Special cases from Netscape spec */ if (LOOKING_AT(s, "expires=")) { diff --git a/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c b/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c index fe4bba2897..629ebe0a0a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c +++ b/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c @@ -38,6 +38,7 @@ #define MSG_HDR_T union http_header_u #include +#include #include "sofia-sip/http_parser.h" #include #include @@ -48,7 +49,6 @@ #include #include -#include #include #include #include @@ -143,8 +143,7 @@ issize_t http_extract_body(msg_t *msg, http_t *http, char b[], isize_t bsiz, int */ http->http_transfer_encoding->k_items && http->http_transfer_encoding->k_items[0] && - strcasecmp(http->http_transfer_encoding->k_items[0], - "identity") != 0) { + !su_casematch(http->http_transfer_encoding->k_items[0], "identity")) { http->http_flags |= MSG_FLG_CHUNKS; if (http->http_flags & MSG_FLG_STREAMING) @@ -162,8 +161,7 @@ issize_t http_extract_body(msg_t *msg, http_t *http, char b[], isize_t bsiz, int body_len = http->http_content_length->l_length; /* We cannot parse multipart/byteranges ... */ else if (http->http_content_type && http->http_content_type->c_type && - strcasecmp(http->http_content_type->c_type, "multipart/byteranges") - == 0) + su_casematch(http->http_content_type->c_type, "multipart/byteranges")) return -1; else if (MSG_IS_MAILBOX(flags)) /* message fragments */ body_len = 0; @@ -312,12 +310,12 @@ int http_version_d(char **ss, char const **ver) char const *result; int const version_size = sizeof(http_version_1_1) - 1; - if (strncasecmp(s, http_version_1_1, version_size) == 0 && + if (su_casenmatch(s, http_version_1_1, version_size) && !IS_TOKEN(s[version_size])) { result = http_version_1_1; s += version_size; } - else if (strncasecmp(s, http_version_1_0, version_size) == 0 && + else if (su_casenmatch(s, http_version_1_0, version_size) && !IS_TOKEN(s[version_size])) { result = http_version_1_0; s += version_size; @@ -349,9 +347,9 @@ int http_version_d(char **ss, char const **ver) s[l1 + 1 + l2] = 0; /* Compare again with compacted version */ - if (strcasecmp(s, http_version_1_1) == 0) + if (su_casematch(s, http_version_1_1)) result = http_version_1_1; - else if (strcasecmp(s, http_version_1_0) == 0) + else if (su_casematch(s, http_version_1_0)) result = http_version_1_0; } @@ -452,7 +450,7 @@ http_method_t http_method_d(char **ss, char const **nname) int code = http_method_unknown; size_t n = 0; -#define MATCH(s, m) (strncasecmp(s, m, n = sizeof(m) - 1) == 0) +#define MATCH(s, m) (su_casenmatch(s, m, n = sizeof(m) - 1)) if (c >= 'a' && c <= 'z') c += 'A' - 'a';