Sync from SUSE:ALP:Source:Standard:1.0 httpcomponents-core revision 4204b75891b8eb5c30cb3c09210d1f72

This commit is contained in:
Adrian Schröter 2024-10-14 14:28:56 +02:00
commit d9fdab7833
6 changed files with 765 additions and 0 deletions

23
.gitattributes vendored Normal file
View 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

BIN
httpcomponents-core-4.4.13-src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
httpcomponents-core-build.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,546 @@
--- httpcomponents-core-4.4.13/httpcore/src/main/java/org/apache/http/impl/io/SessionInputBufferImpl.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore/src/main/java/org/apache/http/impl/io/SessionInputBufferImpl.java 2020-04-01 11:34:15.820448452 +0200
@@ -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;
@@ -364,7 +365,7 @@
}
final CoderResult result = this.decoder.flush(this.cbuf);
len += handleDecodingResult(result, charbuffer, bbuf);
- this.cbuf.clear();
+ ((Buffer)(this.cbuf)).clear();
return len;
}
@@ -375,7 +376,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.13/httpcore/src/main/java/org/apache/http/impl/io/SessionOutputBufferImpl.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore/src/main/java/org/apache/http/impl/io/SessionOutputBufferImpl.java 2020-04-01 11:34:15.820448452 +0200
@@ -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.13/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionInputBuffer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionInputBuffer.java 2020-04-01 11:34:15.820448452 +0200
@@ -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;
@@ -367,7 +368,7 @@
}
final CoderResult result = this.decoder.flush(this.cbuf);
len += handleDecodingResult(result, charbuffer, bbuf);
- this.cbuf.clear();
+ ((Buffer)(this.cbuf)).clear();
return len;
}
@@ -378,7 +379,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.13/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionOutputBuffer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore/src/main/java-deprecated/org/apache/http/impl/io/AbstractSessionOutputBuffer.java 2020-04-01 11:34:15.824448473 +0200
@@ -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.13/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java 2020-04-01 11:34:15.824448473 +0200
@@ -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.13/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java 2020-04-01 11:34:15.824448473 +0200
@@ -31,6 +31,7 @@
import java.net.InetSocketAddress;
import java.net.SocketTimeoutException;
import java.net.URI;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@@ -341,8 +342,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;
@@ -553,7 +554,7 @@
this.httpExchange.setOriginIOControl(ioControl);
// 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.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentDecoder.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentDecoder.java 2020-04-01 11:34:15.824448473 +0200
@@ -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;
@@ -147,9 +148,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.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentEncoder.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/AbstractContentEncoder.java 2020-04-01 11:34:15.824448473 +0200
@@ -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.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java 2020-04-01 11:34:15.824448473 +0200
@@ -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.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java 2020-04-01 11:41:03.098682887 +0200
@@ -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;
@@ -248,9 +249,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;
}
dst.put(this.buffer);
@@ -275,9 +276,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);
}
@@ -328,7 +329,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
@@ -340,7 +341,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));
@@ -361,12 +362,12 @@
result.throwException();
}
if (result.isOverflow()) {
- this.charBuffer.flip();
+ ((Buffer)this.charBuffer).flip();
lineBuffer.append(
this.charBuffer.array(),
this.charBuffer.position(),
this.charBuffer.remaining());
- this.charBuffer.clear();
+ ((Buffer)this.charBuffer).clear();
}
if (result.isUnderflow()) {
break;
@@ -375,7 +376,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(
@@ -385,7 +386,7 @@
}
}
- this.buffer.limit(origLimit);
+ ((Buffer)(this.buffer)).limit(origLimit);
// discard LF if found
int len = lineBuffer.length();
--- httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java 2020-04-01 11:42:00.798999509 +0200
@@ -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;
@@ -259,7 +260,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.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/EntityAsyncContentProducer.java 2020-04-01 11:34:15.828448495 +0200
@@ -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.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/NByteArrayEntity.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/NByteArrayEntity.java 2020-04-01 11:34:15.828448495 +0200
@@ -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.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java 2020-04-01 11:34:15.828448495 +0200
@@ -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.13/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestConsumer.java 2020-04-01 11:34:15.828448495 +0200
@@ -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 ioControl) throws IOException {
int lastRead;
do {
- this.buffer.clear();
+ ((Buffer)(this.buffer)).clear();
lastRead = decoder.read(this.buffer);
} while (lastRead > 0);
}
--- httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java 2019-12-07 14:35:57.000000000 +0100
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java 2020-04-01 11:36:25.309158888 +0200
@@ -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;
@@ -327,7 +328,7 @@
final ByteBuffer inPlainBuf = this.inPlain.acquire();
// Perform operations
- inEncryptedBuf.flip();
+ ((Buffer)inEncryptedBuf).flip();
try {
result = doUnwrap(inEncryptedBuf, inPlainBuf);
} finally {
@@ -448,7 +449,7 @@
final int bytesWritten;
// Perform operation
- outEncryptedBuf.flip();
+ ((Buffer)outEncryptedBuf).flip();
try {
bytesWritten = this.session.channel().write(outEncryptedBuf);
} finally {
@@ -492,7 +493,7 @@
final SSLEngineResult result;
// Perform operations
- inEncryptedBuf.flip();
+ ((Buffer)inEncryptedBuf).flip();
try {
result = doUnwrap(inEncryptedBuf, inPlainBuf);
} finally {
@@ -613,7 +614,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.13/httpcore-nio/src/main/java/org/apache/http/nio/util/ExpandableBuffer.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java/org/apache/http/nio/util/ExpandableBuffer.java 2020-04-01 11:34:15.828448495 +0200
@@ -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.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/NHttpEntityWrapper.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/NHttpEntityWrapper.java 2020-04-01 11:34:15.828448495 +0200
@@ -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 ioControl) 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.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/SkipContentListener.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/entity/SkipContentListener.java 2020-04-01 11:34:15.828448495 +0200
@@ -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 ioControl) throws IOException {
int lastRead;
do {
- buffer.clear();
+ ((Buffer)buffer).clear();
lastRead = decoder.read(buffer);
} while (lastRead > 0);
}
--- httpcomponents-core-4.4.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/protocol/NullNHttpEntity.java 2019-10-23 15:36:25.000000000 +0200
+++ httpcomponents-core-4.4.13/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/protocol/NullNHttpEntity.java 2020-04-01 11:34:15.828448495 +0200
@@ -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 ioControl) throws IOException {
int lastRead;
do {
- buffer.clear();
+ ((Buffer)buffer).clear();
lastRead = decoder.read(buffer);
} while (lastRead > 0);
}

View File

@ -0,0 +1,33 @@
-------------------------------------------------------------------
Sat Mar 19 07:24:19 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Build with source/target levels 8
-------------------------------------------------------------------
Mon Apr 27 11:57:39 UTC 2020 - Fridrich Strba <fstrba@suse.com>
- Upgraded to version 4.4.13
- Removed patch:
* 0001-Re-generated-expired-test-certificates.patch
+ included in this version
- Modified patch:
* httpcomponents-core-java8compat.patch
+ rediffed to changed context
-------------------------------------------------------------------
Sat Oct 5 12:43:58 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Avoid version-less dependencies in pom files, since
xmvn-connector-gradle does not handle them well
-------------------------------------------------------------------
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
View File

@ -0,0 +1,157 @@
#
# spec file for package httpcomponents-core
#
# Copyright (c) 2022 SUSE LLC
#
# 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.13
Release: 0
Summary: Set of low level Java HTTP transport components for HTTP services
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://hc.apache.org/
Source0: https://archive.apache.org/dist/httpcomponents/httpcore/source/httpcomponents-core-%{version}-src.tar.gz
Source1: %{name}-build.tar.xz
Patch0: %{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}
Group: Development/Libraries/Java
%description javadoc
%{summary}.
%prep
%setup -q -a1
%patch0 -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
# adds version "any" if none is specified
%pom_change_dep ::::: ::::: $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