This commit is contained in:
commit
ba0efac0c5
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
BIN
0001-Re-generated-expired-test-certificates.patch
Normal file
BIN
0001-Re-generated-expired-test-certificates.patch
Normal file
Binary file not shown.
3
httpcomponents-core-4.4.10-src.tar.gz
Normal file
3
httpcomponents-core-4.4.10-src.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:700b3e15254aadc5c3f5e897f7c33709b292dc0c2079db094bfdb9444f895572
|
||||
size 559657
|
3
httpcomponents-core-build.tar.xz
Normal file
3
httpcomponents-core-build.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:243894b18c08b95dc2b845ba3d3ab2a2aab2458875c2d39d12bd1c6120a82736
|
||||
size 2964
|
546
httpcomponents-core-java8compat.patch
Normal file
546
httpcomponents-core-java8compat.patch
Normal file
@ -0,0 +1,546 @@
|
||||
--- httpcomponents-core-4.4.10/httpcore/src/main/java/org/apache/http/impl/io/SessionInputBufferImpl.java 2017-06-15 13:33:20.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore/src/main/java/org/apache/http/impl/io/SessionInputBufferImpl.java 2019-03-13 09:49:02.215922903 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
@@ -366,7 +367,7 @@
|
||||
}
|
||||
final CoderResult result = this.decoder.flush(this.cbuf);
|
||||
len += handleDecodingResult(result, charbuffer, bbuf);
|
||||
- this.cbuf.clear();
|
||||
+ ((Buffer)(this.cbuf)).clear();
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -377,7 +378,7 @@
|
||||
if (result.isError()) {
|
||||
result.throwException();
|
||||
}
|
||||
- this.cbuf.flip();
|
||||
+ ((Buffer)(this.cbuf)).flip();
|
||||
final int len = this.cbuf.remaining();
|
||||
while (this.cbuf.hasRemaining()) {
|
||||
charbuffer.append(this.cbuf.get());
|
||||
--- httpcomponents-core-4.4.10/httpcore/src/main/java/org/apache/http/impl/io/SessionOutputBufferImpl.java 2017-05-12 09:14:53.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore/src/main/java/org/apache/http/impl/io/SessionOutputBufferImpl.java 2019-03-13 09:46:50.107248277 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
@@ -269,7 +270,7 @@
|
||||
}
|
||||
final CoderResult result = this.encoder.flush(this.bbuf);
|
||||
handleEncodingResult(result);
|
||||
- this.bbuf.clear();
|
||||
+ ((Buffer)(this.bbuf)).clear();
|
||||
}
|
||||
|
||||
private void handleEncodingResult(final CoderResult result) throws IOException {
|
||||
--- httpcomponents-core-4.4.10/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionInputBuffer.java 2017-05-12 09:14:53.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionInputBuffer.java 2019-03-13 09:44:05.490407553 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -369,7 +370,7 @@
|
||||
}
|
||||
final CoderResult result = this.decoder.flush(this.cbuf);
|
||||
len += handleDecodingResult(result, charbuffer, bbuf);
|
||||
- this.cbuf.clear();
|
||||
+ ((Buffer)(this.cbuf)).clear();
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -380,7 +381,7 @@
|
||||
if (result.isError()) {
|
||||
result.throwException();
|
||||
}
|
||||
- this.cbuf.flip();
|
||||
+ ((Buffer)(this.cbuf)).flip();
|
||||
final int len = this.cbuf.remaining();
|
||||
while (this.cbuf.hasRemaining()) {
|
||||
charbuffer.append(this.cbuf.get());
|
||||
--- httpcomponents-core-4.4.10/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionOutputBuffer.java 2017-05-12 09:14:53.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionOutputBuffer.java 2019-03-13 09:44:13.614449039 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -293,14 +294,14 @@
|
||||
}
|
||||
final CoderResult result = this.encoder.flush(this.bbuf);
|
||||
handleEncodingResult(result);
|
||||
- this.bbuf.clear();
|
||||
+ ((Buffer)(this.bbuf)).clear();
|
||||
}
|
||||
|
||||
private void handleEncodingResult(final CoderResult result) throws IOException {
|
||||
if (result.isError()) {
|
||||
result.throwException();
|
||||
}
|
||||
- this.bbuf.flip();
|
||||
+ ((Buffer)(this.bbuf)).flip();
|
||||
while (this.bbuf.hasRemaining()) {
|
||||
write(this.bbuf.get());
|
||||
}
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java 2017-09-03 13:21:05.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java 2019-03-13 09:50:53.600493731 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.net.InetSocketAddress;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
|
||||
@@ -83,7 +84,7 @@
|
||||
public void outputReady(final IOSession session) {
|
||||
System.out.println("writeable");
|
||||
try {
|
||||
- this.buffer.flip();
|
||||
+ ((Buffer)(this.buffer)).flip();
|
||||
final int bytesWritten = session.channel().write(this.buffer);
|
||||
if (!this.buffer.hasRemaining()) {
|
||||
session.setEventMask(EventMask.READ);
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java 2017-09-03 13:21:05.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java 2019-03-13 09:53:52.393418469 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
import java.io.InterruptedIOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
@@ -343,8 +344,8 @@
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
- this.inBuffer.clear();
|
||||
- this.outBuffer.clear();
|
||||
+ ((Buffer)(this.inBuffer)).clear();
|
||||
+ ((Buffer)(this.outBuffer)).clear();
|
||||
this.target = null;
|
||||
this.id = null;
|
||||
this.responseTrigger = null;
|
||||
@@ -555,7 +556,7 @@
|
||||
this.httpExchange.setOriginIOControl(ioctrl);
|
||||
// Send data to the origin server
|
||||
final ByteBuffer buf = this.httpExchange.getInBuffer();
|
||||
- buf.flip();
|
||||
+ ((Buffer)buf).flip();
|
||||
final int n = encoder.write(buf);
|
||||
buf.compact();
|
||||
System.out.println("[proxy->origin] " + this.httpExchange.getId() + " " + n + " bytes written");
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentDecoder.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentDecoder.java 2019-03-13 10:07:11.833553436 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.impl.nio.codecs;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
@@ -120,9 +121,9 @@
|
||||
if (dst.remaining() > limit) {
|
||||
final int oldLimit = dst.limit();
|
||||
final int newLimit = oldLimit - (dst.remaining() - limit);
|
||||
- dst.limit(newLimit);
|
||||
+ ((Buffer)dst).limit(newLimit);
|
||||
bytesRead = this.channel.read(dst);
|
||||
- dst.limit(oldLimit);
|
||||
+ ((Buffer)dst).limit(oldLimit);
|
||||
} else {
|
||||
bytesRead = this.channel.read(dst);
|
||||
}
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentEncoder.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentEncoder.java 2019-03-13 10:08:17.497898152 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.impl.nio.codecs;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
|
||||
@@ -157,9 +158,9 @@
|
||||
if (src.remaining() > chunk) {
|
||||
final int oldLimit = src.limit();
|
||||
final int newLimit = oldLimit - (src.remaining() - chunk);
|
||||
- src.limit(newLimit);
|
||||
+ ((Buffer)src).limit(newLimit);
|
||||
bytesWritten = doWriteChunk(src, direct);
|
||||
- src.limit(oldLimit);
|
||||
+ ((Buffer)src).limit(oldLimit);
|
||||
} else {
|
||||
bytesWritten = doWriteChunk(src, direct);
|
||||
}
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java 2019-03-13 10:04:27.556703765 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.impl.nio.codecs;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
|
||||
@@ -110,9 +111,9 @@
|
||||
this.lineBuffer.append(Integer.toHexString(chunk));
|
||||
this.buffer.writeLine(this.lineBuffer);
|
||||
final int oldlimit = src.limit();
|
||||
- src.limit(src.position() + chunk);
|
||||
+ ((Buffer)src).limit(src.position() + chunk);
|
||||
this.buffer.write(src);
|
||||
- src.limit(oldlimit);
|
||||
+ ((Buffer)src).limit(oldlimit);
|
||||
} else {
|
||||
// write all
|
||||
this.lineBuffer.clear();
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java 2019-03-13 10:36:24.146708469 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.impl.nio.reactor;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -221,9 +222,9 @@
|
||||
if (this.buffer.remaining() > chunk) {
|
||||
final int oldLimit = this.buffer.limit();
|
||||
final int newLimit = this.buffer.position() + chunk;
|
||||
- this.buffer.limit(newLimit);
|
||||
+ ((Buffer)(this.buffer)).limit(newLimit);
|
||||
dst.put(this.buffer);
|
||||
- this.buffer.limit(oldLimit);
|
||||
+ ((Buffer)(this.buffer)).limit(oldLimit);
|
||||
return len;
|
||||
} else {
|
||||
dst.put(this.buffer);
|
||||
@@ -249,9 +250,9 @@
|
||||
if (this.buffer.remaining() > maxLen) {
|
||||
final int oldLimit = this.buffer.limit();
|
||||
final int newLimit = oldLimit - (this.buffer.remaining() - maxLen);
|
||||
- this.buffer.limit(newLimit);
|
||||
+ ((Buffer)(this.buffer)).limit(newLimit);
|
||||
bytesRead = dst.write(this.buffer);
|
||||
- this.buffer.limit(oldLimit);
|
||||
+ ((Buffer)(this.buffer)).limit(oldLimit);
|
||||
} else {
|
||||
bytesRead = dst.write(this.buffer);
|
||||
}
|
||||
@@ -302,7 +303,7 @@
|
||||
}
|
||||
}
|
||||
final int origLimit = this.buffer.limit();
|
||||
- this.buffer.limit(pos);
|
||||
+ ((Buffer)(this.buffer)).limit(pos);
|
||||
|
||||
final int requiredCapacity = this.buffer.limit() - this.buffer.position();
|
||||
// Ensure capacity of len assuming ASCII as the most likely charset
|
||||
@@ -314,7 +315,7 @@
|
||||
final int off = this.buffer.position();
|
||||
final int len = this.buffer.remaining();
|
||||
linebuffer.append(b, off, len);
|
||||
- this.buffer.position(off + len);
|
||||
+ ((Buffer)(this.buffer)).position(off + len);
|
||||
} else {
|
||||
while (this.buffer.hasRemaining()) {
|
||||
linebuffer.append((char) (this.buffer.get() & 0xff));
|
||||
@@ -335,12 +336,12 @@
|
||||
result.throwException();
|
||||
}
|
||||
if (result.isOverflow()) {
|
||||
- this.charbuffer.flip();
|
||||
+ ((Buffer)(this.buffer)).flip();
|
||||
linebuffer.append(
|
||||
this.charbuffer.array(),
|
||||
this.charbuffer.position(),
|
||||
this.charbuffer.remaining());
|
||||
- this.charbuffer.clear();
|
||||
+ ((Buffer)(this.charbuffer)).clear();
|
||||
}
|
||||
if (result.isUnderflow()) {
|
||||
break;
|
||||
@@ -349,7 +350,7 @@
|
||||
|
||||
// flush the decoder
|
||||
this.chardecoder.flush(this.charbuffer);
|
||||
- this.charbuffer.flip();
|
||||
+ ((Buffer)(this.charbuffer)).flip();
|
||||
// append the decoded content to the line buffer
|
||||
if (this.charbuffer.hasRemaining()) {
|
||||
linebuffer.append(
|
||||
@@ -359,7 +360,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
- this.buffer.limit(origLimit);
|
||||
+ ((Buffer)(this.buffer)).limit(origLimit);
|
||||
|
||||
// discard LF if found
|
||||
int l = linebuffer.length();
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java 2019-03-13 10:30:57.585039770 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.impl.nio.reactor;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -243,7 +244,7 @@
|
||||
eol = true;
|
||||
}
|
||||
this.charbuffer.put(linebuffer.buffer(), offset, l);
|
||||
- this.charbuffer.flip();
|
||||
+ ((Buffer)(this.charbuffer)).flip();
|
||||
|
||||
boolean retry = true;
|
||||
while (retry) {
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java 2019-03-13 10:13:33.467573632 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -65,7 +66,7 @@
|
||||
this.channel = Channels.newChannel(this.entity.getContent());
|
||||
}
|
||||
final int i = this.channel.read(this.buffer);
|
||||
- this.buffer.flip();
|
||||
+ ((Buffer)(this.buffer)).flip();
|
||||
encoder.write(this.buffer);
|
||||
final boolean buffering = this.buffer.hasRemaining();
|
||||
this.buffer.compact();
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/entity/NByteArrayEntity.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/entity/NByteArrayEntity.java 2019-03-13 10:17:13.516740495 +0100
|
||||
@@ -31,6 +31,7 @@
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.http.entity.AbstractHttpEntity;
|
||||
@@ -116,7 +117,7 @@
|
||||
*/
|
||||
@Override
|
||||
public void close() {
|
||||
- this.buf.rewind();
|
||||
+ ((Buffer)(this.buf)).rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java 2019-03-13 10:18:25.637122928 +0100
|
||||
@@ -32,6 +32,7 @@
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
@@ -155,7 +156,7 @@
|
||||
*/
|
||||
@Override
|
||||
public void close() {
|
||||
- this.buf.rewind();
|
||||
+ ((Buffer)(this.buf)).rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java 2019-03-13 10:11:01.842769659 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.nio.protocol;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.http.HttpRequest;
|
||||
@@ -54,7 +55,7 @@
|
||||
final ContentDecoder decoder, final IOControl ioctrl) throws IOException {
|
||||
int lastRead;
|
||||
do {
|
||||
- this.buffer.clear();
|
||||
+ ((Buffer)(this.buffer)).clear();
|
||||
lastRead = decoder.read(this.buffer);
|
||||
} while (lastRead > 0);
|
||||
}
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java 2018-06-26 14:35:43.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java 2019-03-13 10:23:52.638856850 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.ByteChannel;
|
||||
import java.nio.channels.CancelledKeyException;
|
||||
@@ -312,7 +313,7 @@
|
||||
final ByteBuffer inPlainBuf = this.inPlain.acquire();
|
||||
|
||||
// Perform operations
|
||||
- inEncryptedBuf.flip();
|
||||
+ ((Buffer)inEncryptedBuf).flip();
|
||||
result = doUnwrap(inEncryptedBuf, inPlainBuf);
|
||||
inEncryptedBuf.compact();
|
||||
|
||||
@@ -421,7 +422,7 @@
|
||||
final ByteBuffer outEncryptedBuf = this.outEncrypted.acquire();
|
||||
|
||||
// Perform operation
|
||||
- outEncryptedBuf.flip();
|
||||
+ ((Buffer)outEncryptedBuf).flip();
|
||||
final int bytesWritten = this.session.channel().write(outEncryptedBuf);
|
||||
outEncryptedBuf.compact();
|
||||
|
||||
@@ -458,7 +459,7 @@
|
||||
final ByteBuffer inPlainBuf = this.inPlain.acquire();
|
||||
|
||||
// Perform operations
|
||||
- inEncryptedBuf.flip();
|
||||
+ ((Buffer)inEncryptedBuf).flip();
|
||||
final SSLEngineResult result = doUnwrap(inEncryptedBuf, inPlainBuf);
|
||||
inEncryptedBuf.compact();
|
||||
|
||||
@@ -579,7 +580,7 @@
|
||||
final ByteBuffer inPlainBuf = this.inPlain.acquire();
|
||||
|
||||
// Perform opertaions
|
||||
- inPlainBuf.flip();
|
||||
+ ((Buffer)inPlainBuf).flip();
|
||||
final int n = Math.min(inPlainBuf.remaining(), dst.remaining());
|
||||
for (int i = 0; i < n; i++) {
|
||||
dst.put(inPlainBuf.get());
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java/org/apache/http/nio/util/ExpandableBuffer.java 2018-02-16 15:33:59.000000000 +0100
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java/org/apache/http/nio/util/ExpandableBuffer.java 2019-03-13 10:28:16.808218211 +0100
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
package org.apache.http.nio.util;
|
||||
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@@ -85,7 +86,7 @@
|
||||
*/
|
||||
protected void setOutputMode() {
|
||||
if (this.mode != OUTPUT_MODE) {
|
||||
- this.buffer.flip();
|
||||
+ ((Buffer)(this.buffer)).flip();
|
||||
this.mode = OUTPUT_MODE;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +99,7 @@
|
||||
if (this.buffer.hasRemaining()) {
|
||||
this.buffer.compact();
|
||||
} else {
|
||||
- this.buffer.clear();
|
||||
+ ((Buffer)(this.buffer)).clear();
|
||||
}
|
||||
this.mode = INPUT_MODE;
|
||||
}
|
||||
@@ -107,7 +108,7 @@
|
||||
private void expandCapacity(final int capacity) {
|
||||
final ByteBuffer oldbuffer = this.buffer;
|
||||
this.buffer = allocator.allocate(capacity);
|
||||
- oldbuffer.flip();
|
||||
+ ((Buffer)oldbuffer).flip();
|
||||
this.buffer.put(oldbuffer);
|
||||
}
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
* Clears buffer.
|
||||
*/
|
||||
protected void clear() {
|
||||
- this.buffer.clear();
|
||||
+ ((Buffer)(this.buffer)).clear();
|
||||
this.mode = INPUT_MODE;
|
||||
}
|
||||
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/NHttpEntityWrapper.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/NHttpEntityWrapper.java 2019-03-13 10:01:50.723892601 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -86,7 +87,7 @@
|
||||
final ContentEncoder encoder,
|
||||
final IOControl ioctrl) throws IOException {
|
||||
final int i = this.channel.read(this.buffer);
|
||||
- this.buffer.flip();
|
||||
+ ((Buffer)(this.buffer)).flip();
|
||||
encoder.write(this.buffer);
|
||||
final boolean buffering = this.buffer.hasRemaining();
|
||||
this.buffer.compact();
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/SkipContentListener.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/SkipContentListener.java 2019-03-13 10:02:44.656171552 +0100
|
||||
@@ -28,6 +28,7 @@
|
||||
package org.apache.http.nio.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.http.nio.ContentDecoder;
|
||||
@@ -59,7 +60,7 @@
|
||||
final IOControl ioctrl) throws IOException {
|
||||
int lastRead;
|
||||
do {
|
||||
- buffer.clear();
|
||||
+ ((Buffer)buffer).clear();
|
||||
lastRead = decoder.read(buffer);
|
||||
} while (lastRead > 0);
|
||||
}
|
||||
--- httpcomponents-core-4.4.10/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/protocol/NullNHttpEntity.java 2017-05-10 09:30:47.000000000 +0200
|
||||
+++ httpcomponents-core-4.4.10.new/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/protocol/NullNHttpEntity.java 2019-03-13 10:00:53.319595690 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
+import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
@@ -72,7 +73,7 @@
|
||||
final IOControl ioctrl) throws IOException {
|
||||
int lastRead;
|
||||
do {
|
||||
- buffer.clear();
|
||||
+ ((Buffer)buffer).clear();
|
||||
lastRead = decoder.read(buffer);
|
||||
} while (lastRead > 0);
|
||||
}
|
11
httpcomponents-core.changes
Normal file
11
httpcomponents-core.changes
Normal file
@ -0,0 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 13 12:38:27 UTC 2019 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Initial packaging of httpcomponent-core 4.4.10
|
||||
- Generate and customize the ant build files
|
||||
- Added patches:
|
||||
* 0001-Re-generated-expired-test-certificates.patch
|
||||
+ upstream fix to update expired certificates in tests
|
||||
* httpcomponents-core-java8compat.patch
|
||||
+ fix code so that it produces binaries compatible with
|
||||
Java 8
|
157
httpcomponents-core.spec
Normal file
157
httpcomponents-core.spec
Normal file
@ -0,0 +1,157 @@
|
||||
#
|
||||
# spec file for package httpcomponents-core
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%bcond_with tests
|
||||
Name: httpcomponents-core
|
||||
Version: 4.4.10
|
||||
Release: 0
|
||||
Summary: Set of low level Java HTTP transport components for HTTP services
|
||||
License: Apache-2.0
|
||||
Group: Development/Libraries/Java
|
||||
URL: http://hc.apache.org/
|
||||
Source0: http://www.apache.org/dist/httpcomponents/httpcore/source/httpcomponents-core-%{version}-src.tar.gz
|
||||
Source1: %{name}-build.tar.xz
|
||||
# Expired test certificates. Backported from upstream commit 8caeb927a.
|
||||
Patch0: 0001-Re-generated-expired-test-certificates.patch
|
||||
Patch1: %{name}-java8compat.patch
|
||||
BuildRequires: ant
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: javapackages-local
|
||||
BuildArch: noarch
|
||||
%if %{with tests}
|
||||
BuildRequires: ant-junit
|
||||
BuildRequires: apache-commons-lang3
|
||||
BuildRequires: apache-commons-logging
|
||||
BuildRequires: cglib
|
||||
BuildRequires: mockito
|
||||
BuildRequires: objectweb-asm
|
||||
BuildRequires: objenesis
|
||||
BuildConflicts: java-devel >= 9
|
||||
%endif
|
||||
|
||||
%description
|
||||
HttpCore is a set of low level HTTP transport components that can be
|
||||
used to build custom client and server side HTTP services with a
|
||||
minimal footprint. HttpCore supports two I/O models: blocking I/O
|
||||
model based on the classic Java I/O and non-blocking, event driven I/O
|
||||
model based on Java NIO.
|
||||
|
||||
The blocking I/O model may be more appropriate for data intensive, low
|
||||
latency scenarios, whereas the non-blocking model may be more
|
||||
appropriate for high latency scenarios where raw data throughput is
|
||||
less important than the ability to handle thousands of simultaneous
|
||||
HTTP connections in a resource efficient manner.
|
||||
|
||||
%package javadoc
|
||||
Summary: API documentation for %{name}
|
||||
|
||||
%description javadoc
|
||||
%{summary}.
|
||||
|
||||
%prep
|
||||
%setup -q -a1
|
||||
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
# Random test failures on ARM -- 100 ms sleep is not eneough on this
|
||||
# very performant arch, lets make it 2 s
|
||||
sed -i '/Thread.sleep/s/100/2000/' httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
|
||||
|
||||
%pom_remove_plugin :maven-checkstyle-plugin
|
||||
%pom_remove_plugin :apache-rat-plugin
|
||||
%pom_remove_plugin :maven-source-plugin
|
||||
%pom_remove_plugin :maven-javadoc-plugin
|
||||
|
||||
# we don't need these artifacts right now
|
||||
%pom_disable_module httpcore-osgi
|
||||
%pom_disable_module httpcore-ab
|
||||
|
||||
# OSGify modules
|
||||
for module in httpcore httpcore-nio; do
|
||||
%pom_xpath_remove "pom:project/pom:packaging" $module
|
||||
%pom_xpath_inject "pom:project" "<packaging>bundle</packaging>" $module
|
||||
%pom_remove_plugin :maven-jar-plugin $module
|
||||
%pom_xpath_inject "pom:build/pom:plugins" "
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Export-Package>*</Export-Package>
|
||||
<Private-Package></Private-Package>
|
||||
<Automatic-Module-Name>org.apache.httpcomponents.$module</Automatic-Module-Name>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>" $module
|
||||
done
|
||||
|
||||
for module in httpcore httpcore-nio; do
|
||||
%pom_xpath_inject "pom:project" "
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<version>%{version}</version>" $module
|
||||
%pom_remove_parent $module
|
||||
done
|
||||
|
||||
# install JARs to httpcomponents/ for compatibility reasons
|
||||
# several other packages expect to find the JARs there
|
||||
%{mvn_file} ":{*}" httpcomponents/@1
|
||||
|
||||
%build
|
||||
mkdir -p lib
|
||||
%if %{with tests}
|
||||
build-jar-repository -s lib cglib/cglib commons-lang3 commons-logging mockito/mockito-core objectweb-asm/asm objenesis/objenesis
|
||||
%endif
|
||||
%ant \
|
||||
%if %{without tests}
|
||||
-Dtest.skip=true \
|
||||
%endif
|
||||
package javadoc
|
||||
|
||||
%install
|
||||
# jar
|
||||
install -dm 0755 %{buildroot}%{_javadir}/httpcomponents
|
||||
for module in httpcore httpcore-nio; do
|
||||
install -pm 0644 ${module}/target/${module}-%{version}.jar %{buildroot}%{_javadir}/httpcomponents/${module}.jar
|
||||
done
|
||||
# pom
|
||||
install -dm 0755 %{buildroot}%{_mavenpomdir}/httpcomponents
|
||||
for module in httpcore httpcore-nio; do
|
||||
install -pm 0644 ${module}/pom.xml %{buildroot}%{_mavenpomdir}/httpcomponents/${module}.pom
|
||||
%add_maven_depmap httpcomponents/${module}.pom httpcomponents/${module}.jar
|
||||
done
|
||||
# javadoc
|
||||
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
|
||||
for module in httpcore httpcore-nio; do
|
||||
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${module}
|
||||
cp -pr ${module}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${module}/
|
||||
done
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
|
||||
%files -f .mfiles
|
||||
%license LICENSE.txt
|
||||
%doc NOTICE.txt README.txt RELEASE_NOTES.txt
|
||||
|
||||
%files javadoc
|
||||
%license LICENSE.txt
|
||||
%doc NOTICE.txt
|
||||
%{_javadocdir}/%{name}
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user