/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
*/
class Request {
is = rawInputStream;
do {
return;
}
/* skip blank lines */
}
int pos;
return is;
}
return os;
}
/**
* read a line from the stream returning as a String.
* Not used for reading headers.
*/
while (!gotLF) {
if (c == -1) {
return null;
}
if (gotCR) {
if (c == LF) {
gotLF = true;
} else {
gotCR = false;
consume (c);
}
} else {
if (c == CR) {
gotCR = true;
} else {
consume (c);
}
}
}
}
private void consume (int c) {
pos = 0;
}
}
/**
* returns the request line (first line of a request)
*/
return startLine;
}
return hdrs;
}
char s[] = new char[10];
int len = 0;
// check for empty headers
return hdrs;
}
s[0] = (char)firstc;
len = 1;
firstc = c;
}
int keyend = -1;
int c;
switch (c) {
case ':':
inKey = false;
break;
case '\t':
c = ' ';
case ' ':
inKey = false;
break;
case CR:
case LF:
}
break parseloop;
/* continuation */
c = ' ';
break;
}
s = ns;
}
s[len++] = (char) c;
}
firstc = -1;
}
len--;
String k;
if (keyend <= 0) {
k = null;
keyend = 0;
} else {
keyend++;
keyend++;
}
String v;
v = new String();
else
throw new IOException("Maximum number of request headers (" +
"sun.net.httpserver.maxReqHeaders) exceeded, " +
}
len = 0;
}
return hdrs;
}
/**
* Implements blocking reading semantics on top of a non-blocking channel
*/
byte[] one;
boolean marked;
boolean reset;
int readlimit;
static long readTimeout;
one = new byte[1];
}
}
if (result == 1) {
} else {
return -1;
}
}
int canreturn, willreturn;
if (closed)
throw new IOException ("Stream closed");
if (eof) {
return -1;
}
assert channel.isBlocking();
throw new IndexOutOfBoundsException ();
}
if (reset) { /* satisfy from markBuf */
if (canreturn == willreturn) {
reset = false;
}
} else { /* satisfy from channel */
}
do {
} while (willreturn == 0);
if (willreturn == -1) {
eof = true;
return -1;
}
if (marked) { /* copy into markBuf */
try {
} catch (BufferOverflowException e) {
marked = false;
}
}
}
return willreturn;
}
public boolean markSupported () {
return true;
}
/* Does not query the OS socket */
if (closed)
throw new IOException ("Stream is closed");
if (eof)
return -1;
if (reset)
}
if (closed) {
return;
}
closed = true;
}
if (closed)
return;
marked = true;
reset = false;
}
if (closed )
return;
if (!marked)
throw new IOException ("Stream not marked");
marked = false;
reset = true;
}
}
boolean closed;
byte[] one;
assert channel.isBlocking();
closed = false;
one = new byte [1];
}
one[0] = (byte)b;
}
}
int l = len;
if (closed)
throw new IOException ("stream is closed");
}
int n;
l -= n;
if (l == 0)
return;
}
}
if (closed)
return;
//server.logStackTrace ("Request.OS.close: isOpen="+channel.isOpen());
closed = true;
}
}
}