public Connection getConnection() { return _endp.getConnection(); }
public void upgrade() { AsyncHttpConnection connection = (AsyncHttpConnection)_endp.getConnection(); SslConnection sslConnection = new SslConnection(_engine,_endp); _endp.setConnection(sslConnection); _endp=sslConnection.getSslEndPoint(); sslConnection.getSslEndPoint().setConnection(connection); LOG.debug("upgrade {} to {} for {}",this,sslConnection,connection); }
@Override public StreamFrameListener onSyn(final Stream stream, SynInfo synInfo) { // Every time we have a SYN, it maps to a HTTP request. // We can have multiple concurrent SYNs on the same connection, // and this is very different from HTTP, where only one request/response // cycle is processed at a time, so we need to fake an http connection // for each SYN in order to run concurrently. logger.debug("Received {} on {}", synInfo, stream); HTTPSPDYAsyncEndPoint asyncEndPoint = new HTTPSPDYAsyncEndPoint(endPoint, stream); ServerHTTPSPDYAsyncConnection connection = new ServerHTTPSPDYAsyncConnection(connector, asyncEndPoint, connector.getServer(), getVersion(), (SPDYAsyncConnection)endPoint.getConnection(), pushStrategy, stream); asyncEndPoint.setConnection(connection); stream.setAttribute(CONNECTION_ATTRIBUTE, connection); Headers headers = synInfo.getHeaders(); connection.beginRequest(headers, synInfo.isClose()); if (headers.isEmpty()) { // If the SYN has no headers, they may come later in a HEADERS frame return this; } else { if (synInfo.isClose()) return null; else return this; } }