Skip to content

Commit 897ca85

Browse files
bukkatwose
authored andcommitted
Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
This reverts commit d052742. This patch makes Swoole/Swow can not work anymore, because Coroutine will yield to another one during socket operation, EG(record_errors) assertion will always fail, and zend_begin_record_errors() was only used during compile time before. Note: zend_emit_recorded_errors() and the typo fix are reserved.
1 parent d052742 commit 897ca85

File tree

6 files changed

+2
-46
lines changed

6 files changed

+2
-46
lines changed

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ PHP NEWS
4949
- Streams:
5050
. Fixed bug GH-8472 (The resource returned by stream_socket_accept may have
5151
incorrect metadata). (Jakub Zelenka)
52-
. Fixed bug GH-8409 (SSL handshake timeout leaves persistent connections
53-
hanging). (Jakub Zelenka)
5452

5553
04 Aug 2022, PHP 8.1.9
5654

Zend/zend.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,9 +1366,6 @@ ZEND_API ZEND_COLD void zend_error_zstr_at(
13661366
EG(num_errors)++;
13671367
EG(errors) = erealloc(EG(errors), sizeof(zend_error_info) * EG(num_errors));
13681368
EG(errors)[EG(num_errors)-1] = info;
1369-
if (EG(record_errors_without_emitting)) {
1370-
return;
1371-
}
13721369
}
13731370

13741371
/* Report about uncaught exception in case of fatal errors */
@@ -1622,25 +1619,14 @@ ZEND_API ZEND_COLD void zend_error_zstr(int type, zend_string *message) {
16221619
zend_error_zstr_at(type, filename, lineno, message);
16231620
}
16241621

1625-
static zend_always_inline void zend_begin_record_errors_ex(bool no_emmitting)
1622+
ZEND_API void zend_begin_record_errors(void)
16261623
{
16271624
ZEND_ASSERT(!EG(record_errors) && "Error recording already enabled");
16281625
EG(record_errors) = true;
1629-
EG(record_errors_without_emitting) = no_emmitting;
16301626
EG(num_errors) = 0;
16311627
EG(errors) = NULL;
16321628
}
16331629

1634-
ZEND_API void zend_begin_record_errors(void)
1635-
{
1636-
zend_begin_record_errors_ex(false);
1637-
}
1638-
1639-
ZEND_API void zend_begin_record_errors_without_emitting(void)
1640-
{
1641-
zend_begin_record_errors_ex(true);
1642-
}
1643-
16441630
ZEND_API void zend_emit_recorded_errors(void)
16451631
{
16461632
EG(record_errors) = false;

Zend/zend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ ZEND_API void zend_save_error_handling(zend_error_handling *current);
394394
ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current);
395395
ZEND_API void zend_restore_error_handling(zend_error_handling *saved);
396396
ZEND_API void zend_begin_record_errors(void);
397-
ZEND_API void zend_begin_record_errors_without_emitting(void);
398397
ZEND_API void zend_emit_recorded_errors(void);
399398
ZEND_API void zend_free_recorded_errors(void);
400399
END_EXTERN_C()

Zend/zend_globals.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,8 @@ struct _zend_executor_globals {
261261
zend_long fiber_stack_size;
262262

263263
/* If record_errors is enabled, all emitted diagnostics will be recorded,
264-
* in addition to being processed as usual unless record_errors_without_emitting
265-
* is enabled which supresses processing when the errors are recorded. */
264+
* in addition to being processed as usual. */
266265
bool record_errors;
267-
bool record_errors_without_emitting;
268266
uint32_t num_errors;
269267
zend_error_info **errors;
270268

ext/standard/tests/streams/gh8409.phpt

Lines changed: 0 additions & 20 deletions
This file was deleted.

main/streams/transports.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
131131
(char*)name, namelen, persistent_id, options, flags, timeout,
132132
context STREAMS_REL_CC);
133133

134-
zend_begin_record_errors_without_emitting();
135-
136134
if (stream) {
137135
php_stream_context_set(stream, context);
138136

@@ -183,9 +181,6 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
183181
stream = NULL;
184182
}
185183

186-
zend_emit_recorded_errors();
187-
zend_free_recorded_errors();
188-
189184
return stream;
190185
}
191186

0 commit comments

Comments
 (0)