* case-insensitive compare two str's */
| 1295 | * case-insensitive compare two str's |
| 1296 | */ |
| 1297 | static inline int str_strcasecmp(const str *stra, const str *strb) |
| 1298 | { |
| 1299 | int i; |
| 1300 | int alen; |
| 1301 | int blen; |
| 1302 | int minlen; |
| 1303 | |
| 1304 | if(stra==NULL || strb==NULL || stra->s ==NULL || strb->s==NULL |
| 1305 | || stra->len<0 || strb->len<0) |
| 1306 | { |
| 1307 | #ifdef EXTRA_DEBUG |
| 1308 | LM_DBG("bad parameters\n"); |
| 1309 | #endif |
| 1310 | return -2; |
| 1311 | } |
| 1312 | alen = stra->len; |
| 1313 | blen = strb->len; |
| 1314 | minlen = (alen < blen ? alen : blen); |
| 1315 | |
| 1316 | for (i = 0; i < minlen; i++) { |
| 1317 | const char a = tolower(stra->s[i]); |
| 1318 | const char b = tolower(strb->s[i]); |
| 1319 | if (a < b) |
| 1320 | return -1; |
| 1321 | if (a > b) |
| 1322 | return 1; |
| 1323 | } |
| 1324 | if (alen < blen) |
| 1325 | return -1; |
| 1326 | else if (alen > blen) |
| 1327 | return 1; |
| 1328 | else |
| 1329 | return 0; |
| 1330 | } |
| 1331 | |
| 1332 | #define start_expire_timer(begin,threshold) \ |
| 1333 | do { \ |
no outgoing calls
no test coverage detected