1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
From 74984d42a8b71fefc6f3400e0a569f778a0f101e Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 9 Jul 2024 15:33:05 +0200
Subject: [PATCH 1/2] Fix header name for 8.4
---
src/php_http_message_body.c | 4 ++++
src/php_http_misc.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/php_http_message_body.c b/src/php_http_message_body.c
index 8bde1a77..105e369c 100644
--- a/src/php_http_message_body.c
+++ b/src/php_http_message_body.c
@@ -12,7 +12,11 @@
#include "php_http_api.h"
+#if PHP_VERSION_ID < 80400
#include "ext/standard/php_lcg.h"
+#else
+#include "ext/random/php_random.h"
+#endif
#define BOUNDARY_OPEN(body) \
do {\
diff --git a/src/php_http_misc.c b/src/php_http_misc.c
index 261387f6..d5da37fd 100644
--- a/src/php_http_misc.c
+++ b/src/php_http_misc.c
@@ -12,7 +12,11 @@
#include "php_http_api.h"
+#if PHP_VERSION_ID < 80400
#include "ext/standard/php_lcg.h"
+#else
+#include "ext/random/php_random.h"
+#endif
#include "zend_exceptions.h"
/* SLEEP */
From e0919d1756b661573a248c8b83705cd05094c0c8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 9 Jul 2024 15:33:22 +0200
Subject: [PATCH 2/2] Fix tests for 8.4
---
tests/client002.phpt | 2 +-
tests/client028.phpt | 2 +-
tests/info002.phpt | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/client002.phpt b/tests/client002.phpt
index d020f16e..8849ae94 100644
--- a/tests/client002.phpt
+++ b/tests/client002.phpt
@@ -15,7 +15,7 @@ echo "Test\n";
class Observer implements SplObserver
{
#[ReturnTypeWillChange]
- function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
+ function update(SplSubject $client, ?http\Client\Request $request = null, ?StdClass $progress = null) {
echo "P";
/* fence against buggy infof() calls in some curl versions */
$compare = $client->getProgressInfo($request);
diff --git a/tests/client028.phpt b/tests/client028.phpt
index f14fb8e5..58adc685 100644
--- a/tests/client028.phpt
+++ b/tests/client028.phpt
@@ -80,7 +80,7 @@ class UserHandler implements http\Client\Curl\User
return count($this->client);
}
- function wait(int $timeout_ms = null) {
+ function wait(?int $timeout_ms = null) {
echo "W";
if ($timeout_ms === null) {
diff --git a/tests/info002.phpt b/tests/info002.phpt
index 4d034403..44172b8d 100644
--- a/tests/info002.phpt
+++ b/tests/info002.phpt
@@ -37,13 +37,13 @@ Test
http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 4 of 'HTTP/1.1 99 Apples in my Basket' in %sinfo002.php:%d
Stack trace:
#0 %sinfo002.php(%d): http\Message->__construct('HTTP/1.1 99 App...')
-#1 %sinfo002.php(%d): {closure}()
+#1 %sinfo002.php(%d): {closur%s}()
#2 %sinfo002.php(%d): trap(Object(Closure))
#3 {main}
http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 7 of 'CONNECT HTTP/1.1' in %sinfo002.php:%d
Stack trace:
#0 %sinfo002.php(%d): http\Message->__construct('CONNECT HTTP/1....')
-#1 %sinfo002.php(%d): {closure}()
+#1 %sinfo002.php(%d): {closur%s}()
#2 %sinfo002.php(%d): trap(Object(Closure))
#3 {main}
HTTP/1.1 200
|