List of usage examples for org.apache.http.impl.entity StrictContentLengthStrategy StrictContentLengthStrategy
public StrictContentLengthStrategy()
From source file:org.mycard.net.network.AndroidHttpClientConnection.java
public AndroidHttpClientConnection() { this.entityserializer = new EntitySerializer(new StrictContentLengthStrategy()); }
From source file:net.oneandone.sushi.fs.webdav.WebdavConnection.java
public WebdavConnection(Socket socket, SessionInputBuffer input, SessionOutputBuffer output, HttpParams params) {/*www .j a v a2s . c o m*/ this.socket = socket; this.entityserializer = new EntitySerializer(new StrictContentLengthStrategy()); this.entitydeserializer = new EntityDeserializer(new LaxContentLengthStrategy()); this.input = input; this.output = output; this.responseParser = new DefaultHttpResponseParser(input, null, new DefaultHttpResponseFactory(), params); this.requestWriter = new HttpRequestWriter(output, null, params); this.metrics = new HttpConnectionMetricsImpl(input.getMetrics(), output.getMetrics()); this.open = true; }
From source file:org.apache.axis2.transport.http.server.AxisHttpConnectionImpl.java
public AxisHttpConnectionImpl(final Socket socket, final HttpParams params) throws IOException { super();// ww w . j a va 2 s . c om if (socket == null) { throw new IllegalArgumentException("Socket may not be null"); } if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params)); socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params)); int linger = HttpConnectionParams.getLinger(params); if (linger >= 0) { socket.setSoLinger(linger > 0, linger); } int buffersize = HttpConnectionParams.getSocketBufferSize(params); this.socket = socket; this.outbuffer = new SocketOutputBuffer(socket, buffersize, params); this.inbuffer = new SocketInputBuffer(socket, buffersize, params); this.contentLenStrategy = new StrictContentLengthStrategy(); this.requestParser = new HttpRequestParser(this.inbuffer, null, new DefaultHttpRequestFactory(), params); this.responseWriter = new HttpResponseWriter(this.outbuffer, null, params); }