private HttpChannelOverSPDY newHttpChannelOverSPDY(Stream pushStream, Fields pushRequestHeaders) { HttpTransport transport = new PushHttpTransportOverSPDY(connector, configuration, endPoint, pushStrategy, pushStream, pushRequestHeaders, this, version); HttpInputOverSPDY input = new HttpInputOverSPDY(); return new HttpChannelOverSPDY(connector, configuration, endPoint, transport, input, pushStream); }
public void requestHeaders(Fields headers, boolean endRequest) { boolean proceed = performBeginRequest(headers); if (!proceed) return; performHeaders(headers); if (endRequest) { boolean dispatch = headerComplete(); if (messageComplete()) dispatch=true; if (dispatch) dispatch(); } }
private void dispatch() { synchronized (this) { if (dispatched) redispatch=true; else { if (LOG.isDebugEnabled()) LOG.debug("Dispatch {}", this); dispatched=true; execute(this); } } }
public void requestContent(final DataInfo dataInfo, boolean endRequest) if (!headersComplete && headerComplete()) dispatch=true; LOG.debug("Queuing last={} content {}", endRequest, copyDataInfo); if (content(copyDataInfo)) dispatch=true; if (endRequest && messageComplete()) dispatch=true; dispatch();
private boolean performBeginRequest(Fields headers) { short version = stream.getSession().getVersion(); Fields.Field methodHeader = headers.get(HTTPSPDYHeader.METHOD.name(version)); Fields.Field uriHeader = headers.get(HTTPSPDYHeader.URI.name(version)); Fields.Field versionHeader = headers.get(HTTPSPDYHeader.VERSION.name(version)); if (methodHeader == null || uriHeader == null || versionHeader == null) { badMessage(400, "Missing required request line elements"); return false; } HttpMethod httpMethod = HttpMethod.fromString(methodHeader.getValue()); HttpVersion httpVersion = HttpVersion.fromString(versionHeader.getValue()); // TODO should handle URI as byte buffer as some bad clients send WRONG encodings in query string // that we have to deal with ByteBuffer uri = BufferUtil.toBuffer(uriHeader.getValue()); if (LOG.isDebugEnabled()) LOG.debug("HTTP > {} {} {}", httpMethod, uriHeader.getValue(), httpVersion); startRequest(httpMethod, httpMethod.asString(), uri, httpVersion); Fields.Field schemeHeader = headers.get(HTTPSPDYHeader.SCHEME.name(version)); if (schemeHeader != null) getRequest().setScheme(schemeHeader.getValue()); return true; }
pushStrategy, stream, headers); HttpInputOverSPDY input = new HttpInputOverSPDY(); HttpChannelOverSPDY channel = new HttpChannelOverSPDY(connector, httpConfiguration, endPoint, transport, input, stream); stream.setAttribute(CHANNEL_ATTRIBUTE, channel); channel.requestStart(headers, synInfo.isClose());
if (LOG.isDebugEnabled()) LOG.debug("HTTP > {}: {}", name, value); parsedHeader(new HttpField(name,value)); break;