Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110628840
D31000.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D31000.diff
View Options
diff --git a/www/pear-HTTP_Request2/Makefile b/www/pear-HTTP_Request2/Makefile
--- a/www/pear-HTTP_Request2/Makefile
+++ b/www/pear-HTTP_Request2/Makefile
@@ -1,23 +1,27 @@
# Created by: Wen Heping <wenheping@gmail.com>
PORTNAME= HTTP_Request2
-PORTVERSION= 2.4.2
+DISTVERSION= 2.4.2
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= www pear
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= PEAR classes providing an easy way to perform HTTP requests
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/docs/LICENSE
+
BUILD_DEPENDS= ${PEARDIR}/Net/URL2.php:net/pear-Net_URL2@${PHP_FLAVOR}
RUN_DEPENDS= ${PEARDIR}/Net/URL2.php:net/pear-Net_URL2@${PHP_FLAVOR}
+USES= pear
+
OPTIONS_DEFINE= CURL FILEINFO ZLIB
CURL_DESC= PHP CURL extension support
FILEINFO_DESC= PHP FILEINFO extension support
ZLIB_DESC= PECL ZLIB support
-USES= pear
-
CURL_USES= php
CURL_USE= PHP=curl
FILEINFO_USES= php
diff --git a/www/pear-HTTP_Request2/files/patch-HTTP_Request2_SocketWrapper.php b/www/pear-HTTP_Request2/files/patch-HTTP_Request2_SocketWrapper.php
new file mode 100644
--- /dev/null
+++ b/www/pear-HTTP_Request2/files/patch-HTTP_Request2_SocketWrapper.php
@@ -0,0 +1,48 @@
+From 63e6f932ab4004f0c09a080d370861d0323b6d33 Mon Sep 17 00:00:00 2001
+From: Alexey Borzov <avb@php.net>
+Date: Fri, 25 Jun 2021 15:05:27 +0300
+Subject: [PATCH] Attempt to fix #23 or at least be more verbose
+
+--- HTTP/Request2/SocketWrapper.php.orig 2020-09-24 22:12:37 UTC
++++ HTTP/Request2/SocketWrapper.php
+@@ -228,23 +228,31 @@ class HTTP_Request2_SocketWrapper
+ public function write($data)
+ {
+ $totalWritten = 0;
+- while (strlen($data)) {
++ while (strlen($data) && !$this->eof()) {
+ $written = 0;
++ $error = null;
+ $timeouts = $this->_getTimeoutsForStreamSelect();
+
+- $r = [];
++ $r = null;
+ $w = [$this->socket];
+- $e = [];
++ $e = null;
+ if (stream_select($r, $w, $e, $timeouts[0], $timeouts[1])) {
+- // Notice: fwrite(): send of #### bytes failed with errno=10035
+- // A non-blocking socket operation could not be completed immediately.
+- $written = @fwrite($this->socket, $data);
++ set_error_handler(static function ($errNo, $errStr) use (&$error) {
++ if (0 !== (E_NOTICE | E_WARNING) & $errNo) {
++ $error = $errStr;
++ }
++ });
++ $written = fwrite($this->socket, $data);
++ restore_error_handler();
+ }
+ $this->checkTimeout();
+
+- // http://www.php.net/manual/en/function.fwrite.php#96951
+- if (0 === (int)$written) {
+- throw new HTTP_Request2_MessageException('Error writing request');
++ // php_sockop_write() defined in /main/streams/xp_socket.c may return zero written bytes for non-blocking
++ // sockets in case of transient errors. These writes will not have notices raised and should be retried
++ if (false === $written || 0 === $written && null !== $error) {
++ throw new HTTP_Request2_MessageException(
++ 'Error writing request' . (null === $error ? '' : ': ' . $error)
++ );
+ }
+ $data = substr($data, $written);
+ $totalWritten += $written;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 3:40 AM (4 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16765350
Default Alt Text
D31000.diff (3 KB)
Attached To
Mode
D31000: www/pear-HTTP_Request2: Import fix from upstream
Attached
Detach File
Event Timeline
Log In to Comment