public String readLine() throws IOException { String s = this.in.readLine(); if (this.wire.enabled() && s != null) { this.wire.input(s + "[EOL]"); } return s; }
public int readLine(final CharArrayBuffer buffer) throws IOException { int l = this.in.readLine(buffer); if (this.wire.enabled() && l > 0) { int pos = buffer.length() - l; String s = new String(buffer.buffer(), pos, l); this.wire.input(s + "[EOL]"); } return l; }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new ConnectionClosedException("Client closed connection"); } ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor); return this.requestFactory.newHttpRequest(requestline); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
case CHUNK_CRLF: this.buffer.clear(); final int bytesRead1 = this.in.readLine(this.buffer); if (bytesRead1 == -1) { throw new MalformedChunkCodingException( final int bytesRead2 = this.in.readLine(this.buffer); if (bytesRead2 == -1) { throw new ConnectionClosedException("Premature end of chunk coded message body: " +
current.clear(); int l = inbuffer.readLine(current); if (l == -1 || current.length() < 1) { break;
int i = this.in.readLine(this.buffer); if (i == -1) { throw new MalformedChunkCodingException(
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override public String readLine() throws IOException { final String s = this.in.readLine(); if (this.wire.enabled() && s != null) { final String tmp = s + "\r\n"; this.wire.input(tmp.getBytes(this.charset)); } return s; }
public String readLine() throws IOException { String s = this.in.readLine(); if (this.wire.enabled() && s != null) { this.wire.input(s + "[EOL]"); } return s; }
public int readLine(final CharArrayBuffer buffer) throws IOException { final int l = this.in.readLine(buffer); if (this.wire.enabled() && l >= 0) { final int pos = buffer.length() - l; final String s = new String(buffer.buffer(), pos, l); final String tmp = s + "\r\n"; this.wire.input(tmp.getBytes(this.charset)); } return l; }
@Override public int readLine(final CharArrayBuffer buffer) throws IOException { final int l = this.in.readLine(buffer); if (this.wire.enabled() && l >= 0) { final int pos = buffer.length() - l; final String s = new String(buffer.buffer(), pos, l); final String tmp = s + "\r\n"; this.wire.input(tmp.getBytes(this.charset)); } return l; }
public int readLine(final CharArrayBuffer buffer) throws IOException { int l = this.in.readLine(buffer); if (this.wire.enabled() && l > 0) { int pos = buffer.length() - l; String s = new String(buffer.buffer(), pos, l); this.wire.input(s + "[EOL]"); } return l; }
public int readLine(final CharArrayBuffer buffer) throws IOException { int l = this.in.readLine(buffer); if (this.wire.enabled() && l > 0) { int pos = buffer.length() - l; String s = new String(buffer.buffer(), pos, l); this.wire.input(s + "[EOL]"); } return l; }
public int readLine(final CharArrayBuffer buffer) throws IOException { int l = this.in.readLine(buffer); if (this.wire.enabled() && l > 0) { int pos = buffer.length() - l; String s = new String(buffer.buffer(), pos, l); this.wire.input(s + "[EOL]"); } return l; }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new ConnectionClosedException("Client closed connection"); } ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor); return this.requestFactory.newHttpRequest(requestline); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new ConnectionClosedException("Client closed connection"); } ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor); return this.requestFactory.newHttpRequest(requestline); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new ConnectionClosedException("Client closed connection"); } ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor); return this.requestFactory.newHttpRequest(requestline); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); final int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new ConnectionClosedException("Client closed connection"); } final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); final RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor); return this.requestFactory.newHttpRequest(requestline); }