Examples of lessEquals()


Examples of org.apache.http.HttpVersion.lessEquals()

        if (!request.containsHeader(HTTP.TARGET_HOST)) {
            HttpHost targethost = (HttpHost) context
                .getAttribute(HttpExecutionContext.HTTP_TARGET_HOST);
            if (targethost == null) {
                HttpVersion ver = request.getRequestLine().getHttpVersion();
                if (ver.lessEquals(HttpVersion.HTTP_1_0)) {
                    return;
                } else {
                    throw new ProtocolException("Target host missing");
                }
            }
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

                request.setHeader(new GeneratedHeader(HTTP.CONTENT_LEN, "0"));
                return;
            }
            // Must specify a transfer encoding or a content length
            if (entity.isChunked() || entity.getContentLength() < 0) {
                if (ver.lessEquals(HttpVersion.HTTP_1_0)) {
                    throw new ProtocolException(
                            "Chunked transfer encoding not allowed for " + ver);
                }
                request.addHeader(new GeneratedHeader(HTTP.TRANSFER_ENCODING,
                        HTTP.CHUNK_CODING));
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

    }
   
    protected void doService(final HttpRequest request, final HttpResponse response)
            throws HttpException, IOException {
        HttpVersion ver = request.getRequestLine().getHttpVersion();
        if (ver.lessEquals(HttpVersion.HTTP_1_1)) {
            response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
        } else {
            response.setStatusLine(new StatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_IMPLEMENTED));
        }
    }
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

        }
        HttpEntity entity = response.getEntity();
        HttpVersion ver = response.getStatusLine().getHttpVersion();
        if (entity != null) {
            if (entity.getContentLength() < 0) {
                if (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0)) {
                    // if the content length is not known and is not chunk
                    // encoded, the connection cannot be reused
                    return false;
                }
            }
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

        // if the content body cannot be correctly delimited
        HttpEntity entity = response.getEntity();
        if (entity != null) {
            HttpVersion ver = response.getStatusLine().getHttpVersion();
            if (entity.getContentLength() < 0 &&
                    (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0))) {
                response.setHeader(new GeneratedHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE));
                return;
            }
        }
        // Drop connection if requested by the client
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

        // if the content body cannot be correctly delimited
        HttpEntity entity = response.getEntity();
        if (entity != null) {
            HttpVersion ver = response.getStatusLine().getHttpVersion();
            if (entity.getContentLength() < 0 &&
                    (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0))) {
                response.setHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
                return;
            }
        }
        // Drop connection if requested by the client
View Full Code Here

Examples of org.apache.http.HttpVersion.lessEquals()

        if (!request.containsHeader(HTTP.TARGET_HOST)) {
            HttpHost targethost = (HttpHost) context
                .getAttribute(HttpExecutionContext.HTTP_TARGET_HOST);
            if (targethost == null) {
                HttpVersion ver = request.getRequestLine().getHttpVersion();
                if (ver.lessEquals(HttpVersion.HTTP_1_0)) {
                    return;
                } else {
                    throw new ProtocolException("Target host missing");
                }
            }
View Full Code Here

Examples of org.apache.http.ProtocolVersion.lessEquals()

    }

    public Cancellable handle(final HttpRequest request, final HttpAsyncResponseTrigger trigger,
            final HttpContext context) throws HttpException, IOException {
        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
            ver = HttpVersion.HTTP_1_1;
        }
        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK, context);
        this.handler.handle(request, response, context);
        trigger.submitResponse(new BasicAsyncResponseProducer(response));
View Full Code Here

Examples of org.apache.http.ProtocolVersion.lessEquals()

                HttpVersion.HTTP_1_0, code, NStringEntity.create(message), false);
    }

    private HttpResponse create100Continue(final HttpRequest request) {
        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
            // Downgrade protocol version if greater than HTTP/1.1
            ver = HttpVersion.HTTP_1_1;
        }
        return new BasicHttpResponse(ver, HttpStatus.SC_CONTINUE, "Continue");
    }
View Full Code Here

Examples of org.apache.http.ProtocolVersion.lessEquals()

        // if the content body cannot be correctly delimited
        HttpEntity entity = response.getEntity();
        if (entity != null) {
            ProtocolVersion ver = response.getStatusLine().getProtocolVersion();
            if (entity.getContentLength() < 0 &&
                    (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0))) {
                response.setHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
                return;
            }
        }
        // Drop connection if requested by the client
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.