.method(HttpMethod.fromString(method));
addNonSpdyHeadersToRequest(version, headers, request);
if (!clientSynInfo.isClose())
{
request.content(new DeferredContentProvider());
}
sendRequest(clientStream, request);
return new StreamFrameListener.Adapter()
{
@Override
public void onReply(Stream stream, ReplyInfo replyInfo)
{
// We proxy to HTTP so we do not receive replies
throw new UnsupportedOperationException("Not Yet Implemented");
}
@Override
public void onHeaders(Stream stream, HeadersInfo headersInfo)
{
throw new UnsupportedOperationException("Not Yet Implemented");
}
@Override
public void onData(Stream clientStream, final DataInfo clientDataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("received clientDataInfo: {} for stream: {}", clientDataInfo, clientStream);
DeferredContentProvider contentProvider = (DeferredContentProvider)request.getContent();
contentProvider.offer(clientDataInfo.asByteBuffer(true));
if (clientDataInfo.isClose())
contentProvider.close();
}
};
}