head += len;
head += aLine.match(head, IS_TABSP);
len = aLine.match(head, IS_NOT_TABSP);
Bs path = aLine.sub(head, len);
head += len;
head += aLine.match(head, IS_TABSP);
aSelf.version = aLine.sub(head).trim();
// http://host:port/path
Bs host = Bs.BLANK;
int port = 0;
if (Const.S_CONNECT.equals(aSelf.method)) {
int colon = path.indexOf(':');
if (0 <= colon) {
host = path.slice(0, colon);
port = (int) path.sub(colon + 1).toLong();
} else {
host = path;
port = 443;
}
path = Bs.BLANK;
} else if (path.startsWith("http://")) {
path = path.sub(7);
int r = path.indexOf('/');
if (r >= 0) {
host = path.slice(0, r);
path = path.sub(r);
} else {
host = path;
path = Bs.valueOf("/");
}
int c = host.indexOf(':');
if (c < 0) {
port = 80;
} else {
port = (int) host.sub(c + 1).toLong();
host = host.slice(0, c);
}
} else {
host = Bs.valueOf("localhost");
port = 80;