Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.HttpResponse.containsHeader()


  }

  private void writeLocalHttpResponse(HTTPResponseEvent res)
  {
    HttpResponse httpres = buildHttpResponse(res);
    if (!httpres.containsHeader("Connection"))
    {
      httpres.setHeader("Connection", "close");
    }
    local.handleResponse(this, httpres);
    if (httpres.isChunked())
View Full Code Here


                return 8;
            }
        } else if (message instanceof HttpResponse) {
            HttpResponse res = (HttpResponse) message;
            if (res.getStatus().getCode() == 101 &&
                res.containsHeader(Names.SEC_WEBSOCKET_ORIGIN) &&
                res.containsHeader(Names.SEC_WEBSOCKET_LOCATION)) {
                return 16;
            }
        }
View Full Code Here

            }
        } else if (message instanceof HttpResponse) {
            HttpResponse res = (HttpResponse) message;
            if (res.getStatus().getCode() == 101 &&
                res.containsHeader(Names.SEC_WEBSOCKET_ORIGIN) &&
                res.containsHeader(Names.SEC_WEBSOCKET_LOCATION)) {
                return 16;
            }
        }

        return defaultValue;
View Full Code Here

            Channels.write(ctx, future, spdySynStreamFrame, e.getRemoteAddress());

        } else if (msg instanceof HttpResponse) {

            HttpResponse httpResponse = (HttpResponse) msg;
            if (httpResponse.containsHeader(SpdyHttpHeaders.Names.ASSOCIATED_TO_STREAM_ID)) {
                SpdySynStreamFrame spdySynStreamFrame = createSynStreamFrame(httpResponse);
                currentStreamId = spdySynStreamFrame.getStreamId();
                ChannelFuture future = getMessageFuture(ctx, e, currentStreamId, httpResponse);
                Channels.write(ctx, future, spdySynStreamFrame, e.getRemoteAddress());
            } else {
View Full Code Here

    AuditLogEntry logEntry = getLogEntry(ctx);
    Object message = e.getMessage();
    if (message instanceof HttpResponse) {
      HttpResponse response = (HttpResponse) message;
      logEntry.setResponseCode(response.getStatus().getCode());
      if (response.containsHeader(HttpHeaders.Names.CONTENT_LENGTH)) {
        String lengthString = response.getHeader(HttpHeaders.Names.CONTENT_LENGTH);
        try {
          logEntry.setResponseContentLength(Long.valueOf(lengthString));
        } catch (NumberFormatException nfe) {
          LOG.warn("Invalid value for content length in HTTP response message: {}", lengthString, nfe);
View Full Code Here

    @Override
    public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        if (e.getMessage() instanceof HttpResponse) {
            HttpResponse response = (HttpResponse) e.getMessage();
            Integer id = ids.poll();
            if (id != null && id.intValue() != NO_ID && !response.containsHeader(SpdyHttpHeaders.Names.STREAM_ID)) {
                SpdyHttpHeaders.setStreamId(response, id);
            }
        }
        super.writeRequested(ctx, e);
    }
View Full Code Here

            Channels.write(ctx, future, spdySynStreamFrame, e.getRemoteAddress());

        } else if (msg instanceof HttpResponse) {

            HttpResponse httpResponse = (HttpResponse) msg;
            if (httpResponse.containsHeader(SpdyHttpHeaders.Names.ASSOCIATED_TO_STREAM_ID)) {
                SpdySynStreamFrame spdySynStreamFrame = createSynStreamFrame(httpResponse);
                int streamID = spdySynStreamFrame.getStreamId();
                ChannelFuture future = getContentFuture(ctx, e, streamID, httpResponse);
                Channels.write(ctx, future, spdySynStreamFrame, e.getRemoteAddress());
            } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.