for (int i = 0; i < done.size(); i++) { RapidoidConnection conn = done.get(i); if (conn.key != null && conn.key.isValid()) {
for (int i = 0; i < done.size(); i++) { RapidoidConnection conn = done.get(i); if (conn.key != null && conn.key.isValid()) {
protected MapEntry<K, V> findEntry(K key, SimpleList<MapEntry<K, V>> bucket) { for (int i = 0; i < bucket.size(); i++) { MapEntry<K, V> entry = bucket.get(i); if (U.eq(entry.key, key)) { return entry; } } return null; }
for (int i = 0; i < waitingToWrite.size(); i++) { RapidoidConnection conn = waitingToWrite.get(i); if (conn.key != null && conn.key.isValid()) {
public Handler findHandler(Buf buf, Range action, Range path) { long hash = hash(buf.bytes(), action, path); SimpleList<Route> candidates = routes.get(hash); if (candidates != null) { for (int i = 0; i < candidates.size(); i++) { Route route = candidates.get(i); if (BytesUtil.matches(buf.bytes(), action, route.action, true) && BytesUtil.startsWith(buf.bytes(), path, route.path, true)) { int pos = path.start + route.path.length; if (path.limit() == pos || buf.get(pos) == '/') { return route.handler; } } } } return null; }
private Handler findHandler(HttpExchangeImpl x) { Buf buf = x.input(); Range action = x.verb_().range(); Range path = x.path_().range(); // serveStaticFileIfExists(x, buf, path); long hash = hash(buf.bytes(), action, path); synchronized (this) { SimpleList<Route> candidates = routes.get(hash); candidates = routes.get(hash); if (candidates != null) { for (int i = 0; i < candidates.size(); i++) { Route route = candidates.get(i); if (BytesUtil.matches(buf.bytes(), action, route.action, true) && BytesUtil.startsWith(buf.bytes(), path, route.path, true)) { int pos = path.start + route.path.length; if (path.limit() == pos || buf.get(pos) == '/') { x.setSubpath(pos, path.limit()); return route.handler; } } } } if (genericHandler != null) { x.setSubpath(path.start, path.limit()); return genericHandler; } } throw x.notFound(); }