// us a different FilterChain to use. If so, we need
// use a different FilterChainContext when invoking sendRequest().
sendingCtx = checkAndHandleFilterChainUpdate(ctx, sendingCtx);
}
final Connection c = ctx.getConnection();
final HttpContext httpCtx;
if (!Utils.isSpdyConnection(c)) {
httpCtx = HttpContext.newInstance(c, c, c, requestPacketLocal);
} else {
SpdySession session = SpdySession.get(c);
final Lock lock = session.getNewClientStreamLock();
try {
lock.lock();
SpdyStream stream = session.openStream(requestPacketLocal, session.getNextLocalStreamId(), 0, 0, 0, false,
!requestPacketLocal.isExpectContent());
httpCtx = HttpContext.newInstance(stream, stream, stream, requestPacketLocal);
} finally {
lock.unlock();
}
}
httpCtx.attach(ctx);
HttpTxContext.set(ctx, httpTxContext);
requestPacketLocal.getProcessingState().setHttpContext(httpCtx);
requestPacketLocal.setConnection(c);
return sendRequest(sendingCtx, request, requestPacketLocal,