faster isCGI()

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5717 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 16 years ago
parent f75628e53b
commit 359a238acf

@ -658,18 +658,23 @@ public class yacyURL implements Serializable {
public final boolean isCGI() {
final String ls = path.toLowerCase();
int pos;
return ls.indexOf(".cgi") >= 0 ||
ls.indexOf(".exe") >= 0 ||
(ls.indexOf("sid") >= 0 &&
(ls.indexOf("?sid") >= 0 || ls.indexOf("&sid") >= 0) &&
(ls.indexOf("sid=") >= 0 || ls.indexOf("sid%") >= 0)) ||
((pos = ls.indexOf("sid")) > 0 &&
(ls.charAt(--pos) == '?' || ls.charAt(pos) == '&') &&
(pos += 4) < ls.length() &&
(ls.charAt(pos) == '=' || ls.charAt(pos) == '%')
) ||
(ls.indexOf("sessionid") >= 0 &&
(ls.indexOf("sessionid=") >= 0 || ls.indexOf("sessionid%") >= 0 || ls.indexOf("sessionid/") >= 0 )) ||
((pos = ls.indexOf("sessionid")) >= 0 && (pos += 10) < ls.length() &&
(ls.charAt(--pos) == '=' || ls.charAt(pos) == '%' || ls.charAt(pos) == '/')
) ||
(ls.indexOf("phpsessid") >= 0 &&
(ls.indexOf("phpsessid=") >= 0 || ls.indexOf("phpsessid%") >= 0));
((pos = ls.indexOf("phpsessid")) >= 0 && (pos += 10) < ls.length() &&
(ls.charAt(--pos) == '=' || ls.charAt(pos) == '%')
);
}

Loading…
Cancel
Save