Skip to content

Commit 709813f

Browse files
committed
1 parent 63ff79d commit 709813f

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

ext-src/php_swoole.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@ extern ZEND_DECLARE_MODULE_GLOBALS(swoole);
425425
#endif
426426
/*}}}*/
427427

428+
#if PHP_VERSION_ID < 70400
429+
typedef size_t php_stream_size_t;
430+
#else
431+
typedef ssize_t php_stream_size_t;
432+
#endif
433+
428434
/* PHP 7 wrapper functions / macros */
429435

430436
//----------------------------------Zval API------------------------------------

ext-src/swoole_runtime.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737
#define HAVE_SEC_LEVEL 1
3838
#endif
3939

40-
#if PHP_VERSION_ID < 70400
41-
typedef size_t php_stream_size_t;
42-
#else
43-
typedef ssize_t php_stream_size_t;
44-
#endif
45-
4640
using swoole::Coroutine;
4741
using swoole::PHPCoroutine;
4842
using swoole::coroutine::Socket;

thirdparty/php/streams/plain_wrapper.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818

1919
/* $Id$ */
2020

21-
#include "php.h"
22-
#include "php_globals.h"
23-
#include "php_network.h"
21+
#include "php_swoole.h"
2422
#include "php_open_temporary_file.h"
2523
#include "ext/standard/file.h"
2624
#include "ext/standard/flock_compat.h"
2725
#include "ext/standard/php_filestat.h"
28-
#include <stddef.h>
26+
2927
#include <fcntl.h>
3028
#if HAVE_SYS_WAIT_H
3129
#include <sys/wait.h>
@@ -36,15 +34,8 @@
3634
#ifdef HAVE_SYS_MMAN_H
3735
#include <sys/mman.h>
3836
#endif
39-
#include "SAPI.h"
4037

4138
#include "thirdparty/php/streams/php_streams_int.h"
42-
#ifdef PHP_WIN32
43-
#include "win32/winutil.h"
44-
#include "win32/time.h"
45-
#include "win32/ioutil.h"
46-
#include "win32/readdir.h"
47-
#endif
4839

4940
#include "swoole_file_hook.h"
5041

@@ -891,6 +882,9 @@ static php_stream *stream_opener(php_stream_wrapper *wrapper,
891882
if (options & STREAM_OPEN_FOR_INCLUDE) {
892883
_open_for_include:
893884
stream = php_stream_fopen_rel(path, mode, opened_path, options);
885+
if (stream == NULL) {
886+
return NULL;
887+
}
894888
stream->ops = php_swoole_get_ori_php_stream_stdio_ops();
895889
return stream;
896890
}

0 commit comments

Comments
 (0)