Refine search
@Override public SocketAddress clientAddress() { return getEndPoint().getRemoteAddress(); }
@Override public SocketAddress serverAddress() { return getEndPoint().getLocalAddress(); }
synchronized(_decryptedEndPoint) if (LOG.isDebugEnabled()) LOG.debug(">needFillInterest uf={} {}", _underflown, SslConnection.this); LOG.debug("ei={} di={}",BufferUtil.toDetailString(_encryptedInput),BufferUtil.toDetailString(_decryptedInput)); fillable = BufferUtil.hasContent(_decryptedInput) || (BufferUtil.hasContent(_encryptedInput) && !_underflown); HandshakeStatus status = _sslEngine.getHandshakeStatus(); switch (status) getEndPoint().write(_incompleteWriteCallback, write); else if (fillable) getExecutor().execute(_runFillable);
while (_endp.isOpen() && connection==this) if (!_parser.isComplete() && !_endp.isInputShutdown()) _parser.parseAvailable(); if (_generator.isCommitted() && !_generator.isComplete() && !_endp.isOutputShutdown()) _generator.flushBuffer(); _endp.flush(); if (LOG.isDebugEnabled()) LOG.debug("uri="+_uri); LOG.debug("fields="+_requestFields); LOG.debug(e); _endp.shutdownOutput(); if (!_generator.isPersistent() && !_endp.isOutputShutdown()) LOG.warn("Safety net oshut!!! Please open a bugzilla"); _endp.shutdownOutput(); if (_endp.isInputShutdown() && _generator.isIdle() && !_request.getAsyncContinuation().isSuspended()) _endp.close();
if (LOG.isDebugEnabled()) LOG.debug("{} shutdownOutput: oshut={}, ishut={}", SslConnection.this, oshut, ishut); if (ishut) getEndPoint().close(); _sslEngine.closeOutbound(); LOG.ignore(e); getEndPoint().close();
_channel.getRequest().getHttpInput().consumeAll(); Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE); if (connection != null) LOG.debug("Upgrade from {} to {}", this, connection); onClose(); getEndPoint().setConnection(connection); connection.onOpen(); reset(); LOG.debug("{} pipelined", this); LOG.warn(e); else LOG.ignore(e); getEndPoint().close(); getEndPoint().close(); if (getEndPoint().isOpen() && getEndPoint().isOutputShutdown())
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }
int filled = endPoint.fill(buffer); if (filled == 0) LOG.debug("read - EOF Reached"); return -1; if (LOG.isDebugEnabled()) LOG.debug("Filled {} bytes - {}",filled,BufferUtil.toDetailString(buffer));
int len = _endp.flush(_header); if (len<0 || !_endp.isOpen()) throw new EofException(); if (len==0) Thread.sleep(100); LOG.debug(e); throw new InterruptedIOException(e.toString());
int filled = endPoint.fill(buffer); if (filled == 0) if (LOG.isDebugEnabled()) LOG.debug("read - EOF Reached (remote: {})",getRemoteAddress()); return ReadMode.EOF; if (LOG.isDebugEnabled()) LOG.debug("Discarded {} bytes - {}",filled,BufferUtil.toDetailString(buffer));
while (event && BufferUtil.hasContent(_requestBuffer) && _parser.inContentState()) _parser.parseNext(_requestBuffer); if (BufferUtil.isEmpty(_requestBuffer)) if (getEndPoint().isInputShutdown()) getEndPoint().fillInterested(_readBlocker); LOG.debug("{} block readable on {}",this,_readBlocker); _readBlocker.block(); long content_length=_channel.getRequest().getContentLength(); int size=getInputBufferSize(); if (size<content_length) int filled=getEndPoint().fill(_requestBuffer); LOG.debug("{} block filled {}",this,filled); if (filled<0) throw new EofException(e);
@Override public void shutdownOutput() { _sslEngine.closeOutbound(); try { flush(BufferUtil.EMPTY_BUFFER); } catch (IOException e) { LOG.ignore(e); getEndPoint().close(); } }
@Override public void disconnect() { if (LOG.isDebugEnabled()) LOG.debug("{} disconnect()",policy.getBehavior()); flusher.terminate(new EOFException("Disconnected"), false); EndPoint endPoint = getEndPoint(); // We need to gently close first, to allow // SSL close alerts to be sent by Jetty endPoint.shutdownOutput(); endPoint.close(); }
private Action flush() if (!BufferUtil.isEmpty(aggregate)) if (LOG.isDebugEnabled()) LOG.debug("{} flushing aggregate {}", this, aggregate); if (BufferUtil.hasContent(payload)) buffers.add(payload); if (LOG.isDebugEnabled()) LOG.debug("{} flushing {} frames: {}", this, entries.size(), entries); endPoint.write(this, buffers.toArray(new ByteBuffer[buffers.size()])); buffers.clear(); return Action.SCHEDULED;
/** * <p>Writes (with non-blocking semantic) the given buffer of data onto the given endPoint.</p> * * @param endPoint the endPoint to write to * @param buffer the buffer to write * @param callback the completion callback to invoke * @param context the context information related to the connection */ protected void write(EndPoint endPoint, ByteBuffer buffer, Callback callback, ConcurrentMap<String, Object> context) { if (LOG.isDebugEnabled()) LOG.debug("{} writing {} bytes", this, buffer.remaining()); endPoint.write(callback, buffer); }
@Override public void onFillable() { try { while (true) { // Avoid to read too much from the socket: ask // the parser how much left there is to read. ByteBuffer buffer = BufferUtil.allocate(parser.expected()); int filled = getEndPoint().fill(buffer); if (LOG.isDebugEnabled()) LOG.debug("Read SOCKS4 connect response, {} bytes", filled); if (filled < 0) throw new IOException("SOCKS4 tunnel failed, connection closed"); if (filled == 0) { fillInterested(); return; } if (parser.parse(buffer)) return; } } catch (Throwable x) { failed(x); } }
LOG.warn("HttpParser Full for {} ",_endp); _buffer.clear(); throw new HttpException(HttpStatus.REQUEST_ENTITY_TOO_LARGE_413, "Request Entity Too Large: "+(_buffer==_body?"body":"head")); int filled = _endp.fill(_buffer); return filled; LOG.debug(e); throw (e instanceof EofException) ? e:new EofException(e);
protected void headerComplete() throws IOException if (_endp.isOutputShutdown()) _endp.close(); return; _generator.setPersistent(true); else if (HttpMethods.CONNECT.equals(_request.getMethod())) _generator.setDate(_request.getTimeStampBuffer()); break; _generator.setDate(_request.getTimeStampBuffer()); LOG.debug("!host {}",this); _generator.setResponse(HttpStatus.BAD_REQUEST_400, null); _responseFields.put(HttpHeaders.CONNECTION_BUFFER, HttpHeaderValues.CLOSE_BUFFER); LOG.debug("!expectation {}",this); _generator.setResponse(HttpStatus.EXPECTATION_FAILED_417, null); _responseFields.put(HttpHeaders.CONNECTION_BUFFER, HttpHeaderValues.CLOSE_BUFFER);