public UpgradeConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise) { super(endp,executor); this.connectPromise = connectPromise; this.bufferPool = connectPromise.getClient().getBufferPool(); this.request = connectPromise.getRequest(); // Setup the parser this.parser = new HttpResponseHeaderParser(); }
public ClientUpgradeResponse parse(ByteBuffer buf) throws ParseException { while (!isDone() && (buf.remaining() > 0)) { String line = lineParser.parse(buf); if (line != null) { if (parseHeader(line)) { // Finished parsing entire header ByteBuffer copy = ByteBuffer.allocateDirect(buf.remaining()); BufferUtil.put(buf,copy); BufferUtil.flipToFlush(copy,0); this.response.setRemainingBuffer(copy); return this.response; } } } return null; }
ClientUpgradeResponse resp = parser.parse(buffer); if (resp != null)
ClientUpgradeResponse resp = parser.parse(buffer); if (resp != null)
public ClientUpgradeResponse parse(ByteBuffer buf) throws ParseException { while (!isDone() && (buf.remaining() > 0)) { String line = lineParser.parse(buf); if (line != null) { if (parseHeader(line)) { // Finished parsing entire header ByteBuffer copy = ByteBuffer.allocateDirect(buf.remaining()); BufferUtil.put(buf,copy); BufferUtil.flipToFlush(copy,0); this.response.setRemainingBuffer(copy); return this.response; } } } return null; }
public UpgradeConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise) { super(endp,executor); this.connectPromise = connectPromise; this.bufferPool = connectPromise.getClient().getBufferPool(); this.request = connectPromise.getRequest(); // Setup the parser this.parser = new HttpResponseHeaderParser(); }