summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-12-14 22:14:36 +0300
committerDmitry Stogov <dmitry@zend.com>2017-12-14 22:14:36 +0300
commit83e495e0fdc0c59b449bd173d0c8df1999239634 (patch)
tree80eb0e2e63b10f988add83a7d494838bd2cf9e56 /main
parent5d367636389506d3aff2220b0f4c6f14a59f98ea (diff)
downloadphp-git-83e495e0fdc0c59b449bd173d0c8df1999239634.tar.gz
Move constants into read-only data segment
Diffstat (limited to 'main')
-rw-r--r--main/SAPI.c8
-rw-r--r--main/SAPI.h6
-rw-r--r--main/php_content_types.c2
-rw-r--r--main/php_memory_streams.h6
-rw-r--r--main/php_network.h4
-rw-r--r--main/php_streams.h8
-rw-r--r--main/snprintf.c6
-rw-r--r--main/streams/filter.c12
-rw-r--r--main/streams/glob_wrapper.c4
-rw-r--r--main/streams/memory.c8
-rw-r--r--main/streams/php_stream_filter_api.h8
-rw-r--r--main/streams/php_stream_glob_wrapper.h4
-rw-r--r--main/streams/php_stream_userspace.h4
-rw-r--r--main/streams/plain_wrapper.c5
-rw-r--r--main/streams/streams.c2
-rw-r--r--main/streams/userspace.c6
-rw-r--r--main/streams/xp_socket.c22
17 files changed, 58 insertions, 57 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index ed5aac072c..835bddab64 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -932,9 +932,9 @@ SAPI_API int sapi_send_headers(void)
}
-SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries)
+SAPI_API int sapi_register_post_entries(const sapi_post_entry *post_entries)
{
- sapi_post_entry *p=post_entries;
+ const sapi_post_entry *p=post_entries;
while (p->content_type) {
if (sapi_register_post_entry(p) == FAILURE) {
@@ -946,7 +946,7 @@ SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries)
}
-SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry)
+SAPI_API int sapi_register_post_entry(const sapi_post_entry *post_entry)
{
int ret;
zend_string *key;
@@ -961,7 +961,7 @@ SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry)
return ret;
}
-SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry)
+SAPI_API void sapi_unregister_post_entry(const sapi_post_entry *post_entry)
{
if (SG(sapi_started) && EG(current_execute_data)) {
return;
diff --git a/main/SAPI.h b/main/SAPI.h
index 1516702edf..e72f1bbb4e 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -190,9 +190,9 @@ SAPI_API int sapi_send_headers(void);
SAPI_API void sapi_free_header(sapi_header_struct *sapi_header);
SAPI_API void sapi_handle_post(void *arg);
SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen);
-SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry);
-SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry);
-SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry);
+SAPI_API int sapi_register_post_entries(const sapi_post_entry *post_entry);
+SAPI_API int sapi_register_post_entry(const sapi_post_entry *post_entry);
+SAPI_API void sapi_unregister_post_entry(const sapi_post_entry *post_entry);
SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(void));
SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray));
SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int (*input_filter_init)(void));
diff --git a/main/php_content_types.c b/main/php_content_types.c
index 37da97a395..602061f417 100644
--- a/main/php_content_types.c
+++ b/main/php_content_types.c
@@ -26,7 +26,7 @@
/* {{{ php_post_entries[]
*/
-static sapi_post_entry php_post_entries[] = {
+static const sapi_post_entry php_post_entries[] = {
{ DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler },
{ MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
{ NULL, 0, NULL, NULL }
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index 271a9276e0..b7f0ce8488 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -56,9 +56,9 @@ PHPAPI const char *_php_stream_mode_to_str(int mode);
END_EXTERN_C()
-extern PHPAPI php_stream_ops php_stream_memory_ops;
-extern PHPAPI php_stream_ops php_stream_temp_ops;
-extern PHPAPI php_stream_ops php_stream_rfc2397_ops;
+extern PHPAPI const php_stream_ops php_stream_memory_ops;
+extern PHPAPI const php_stream_ops php_stream_temp_ops;
+extern PHPAPI const php_stream_ops php_stream_rfc2397_ops;
extern PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper;
#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops
diff --git a/main/php_network.h b/main/php_network.h
index ee02fd19fd..c5a297e2ec 100644
--- a/main/php_network.h
+++ b/main/php_network.h
@@ -299,8 +299,8 @@ struct _php_netstream_data_t {
size_t ownsize;
};
typedef struct _php_netstream_data_t php_netstream_data_t;
-PHPAPI extern php_stream_ops php_stream_socket_ops;
-extern php_stream_ops php_stream_generic_socket_ops;
+PHPAPI extern const php_stream_ops php_stream_socket_ops;
+extern const php_stream_ops php_stream_generic_socket_ops;
#define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops)
BEGIN_EXTERN_C()
diff --git a/main/php_streams.h b/main/php_streams.h
index c268295933..ecc63cae42 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -161,7 +161,7 @@ typedef struct _php_stream_wrapper_ops {
} php_stream_wrapper_ops;
struct _php_stream_wrapper {
- php_stream_wrapper_ops *wops; /* operations the wrapper can perform */
+ const php_stream_wrapper_ops *wops; /* operations the wrapper can perform */
void *abstract; /* context for the wrapper */
int is_url; /* so that PG(allow_url_fopen) can be respected */
};
@@ -188,7 +188,7 @@ struct _php_stream_wrapper {
#define PHP_STREAM_FLAG_WAS_WRITTEN 0x80000000
struct _php_stream {
- php_stream_ops *ops;
+ const php_stream_ops *ops;
void *abstract; /* convenience pointer for abstraction */
php_stream_filter_chain readfilters, writefilters;
@@ -246,7 +246,7 @@ struct _php_stream {
/* allocate a new stream for a particular ops */
BEGIN_EXTERN_C()
-PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract,
+PHPAPI php_stream *_php_stream_alloc(const php_stream_ops *ops, void *abstract,
const char *persistent_id, const char *mode STREAMS_DC);
END_EXTERN_C()
#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC)
@@ -593,7 +593,7 @@ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void);
PHPAPI HashTable *_php_get_stream_filters_hash(void);
#define php_get_stream_filters_hash() _php_get_stream_filters_hash()
PHPAPI HashTable *php_get_stream_filters_hash_global(void);
-extern php_stream_wrapper_ops *php_stream_user_wrapper_ops;
+extern const php_stream_wrapper_ops *php_stream_user_wrapper_ops;
END_EXTERN_C()
#endif
diff --git a/main/snprintf.c b/main/snprintf.c
index a6788c7f79..d71b732e3f 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -487,9 +487,9 @@ PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits, char f
{
register int mask = (1 << nbits) - 1;
register char *p = buf_end;
- static char low_digits[] = "0123456789abcdef";
- static char upper_digits[] = "0123456789ABCDEF";
- register char *digits = (format == 'X') ? upper_digits : low_digits;
+ static const char low_digits[] = "0123456789abcdef";
+ static const char upper_digits[] = "0123456789ABCDEF";
+ register const char *digits = (format == 'X') ? upper_digits : low_digits;
do {
*--p = digits[num & mask];
diff --git a/main/streams/filter.c b/main/streams/filter.c
index 16c99998f9..a09b9104c9 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -44,11 +44,11 @@ PHPAPI HashTable *_php_get_stream_filters_hash(void)
}
/* API for registering GLOBAL filters */
-PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory)
+PHPAPI int php_stream_filter_register_factory(const char *filterpattern, const php_stream_filter_factory *factory)
{
int ret;
zend_string *str = zend_string_init_interned(filterpattern, strlen(filterpattern), 1);
- ret = zend_hash_add_ptr(&stream_filters_hash, str, factory) ? SUCCESS : FAILURE;
+ ret = zend_hash_add_ptr(&stream_filters_hash, str, (void*)factory) ? SUCCESS : FAILURE;
zend_string_release(str);
return ret;
}
@@ -59,7 +59,7 @@ PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern)
}
/* API for registering VOLATILE wrappers */
-PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpattern, php_stream_filter_factory *factory)
+PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpattern, const php_stream_filter_factory *factory)
{
if (!FG(stream_filters)) {
ALLOC_HASHTABLE(FG(stream_filters));
@@ -67,7 +67,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpatter
zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL);
}
- return zend_hash_add_ptr(FG(stream_filters), filterpattern, factory) ? SUCCESS : FAILURE;
+ return zend_hash_add_ptr(FG(stream_filters), filterpattern, (void*)factory) ? SUCCESS : FAILURE;
}
/* Buckets */
@@ -224,7 +224,7 @@ PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket)
PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
{
HashTable *filter_hash = (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash);
- php_stream_filter_factory *factory = NULL;
+ const php_stream_filter_factory *factory = NULL;
php_stream_filter *filter = NULL;
size_t n;
char *period;
@@ -264,7 +264,7 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval
return filter;
}
-PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, uint8_t persistent STREAMS_DC)
+PHPAPI php_stream_filter *_php_stream_filter_alloc(const php_stream_filter_ops *fops, void *abstract, uint8_t persistent STREAMS_DC)
{
php_stream_filter *filter;
diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c
index 1350962837..0b992a1a23 100644
--- a/main/streams/glob_wrapper.c
+++ b/main/streams/glob_wrapper.c
@@ -195,7 +195,7 @@ static int php_glob_stream_rewind(php_stream *stream, zend_off_t offset, int whe
}
/* }}} */
-php_stream_ops php_glob_stream_ops = {
+const php_stream_ops php_glob_stream_ops = {
NULL, php_glob_stream_read,
php_glob_stream_close, NULL,
"glob",
@@ -261,7 +261,7 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha
}
/* }}} */
-static php_stream_wrapper_ops php_glob_stream_wrapper_ops = {
+static const php_stream_wrapper_ops php_glob_stream_wrapper_ops = {
NULL,
NULL,
NULL,
diff --git a/main/streams/memory.c b/main/streams/memory.c
index d6b0e5604b..c1ef32f88b 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -264,7 +264,7 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu
}
/* }}} */
-PHPAPI php_stream_ops php_stream_memory_ops = {
+PHPAPI const php_stream_ops php_stream_memory_ops = {
php_stream_memory_write, php_stream_memory_read,
php_stream_memory_close, php_stream_memory_flush,
"MEMORY",
@@ -560,7 +560,7 @@ static int php_stream_temp_set_option(php_stream *stream, int option, int value,
}
/* }}} */
-PHPAPI php_stream_ops php_stream_temp_ops = {
+PHPAPI const php_stream_ops php_stream_temp_ops = {
php_stream_temp_write, php_stream_temp_read,
php_stream_temp_close, php_stream_temp_flush,
"TEMP",
@@ -622,7 +622,7 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char
}
/* }}} */
-PHPAPI php_stream_ops php_stream_rfc2397_ops = {
+PHPAPI const php_stream_ops php_stream_rfc2397_ops = {
php_stream_temp_write, php_stream_temp_read,
php_stream_temp_close, php_stream_temp_flush,
"RFC2397",
@@ -772,7 +772,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
return stream;
}
-PHPAPI php_stream_wrapper_ops php_stream_rfc2397_wops = {
+PHPAPI const php_stream_wrapper_ops php_stream_rfc2397_wops = {
php_stream_url_wrap_rfc2397,
NULL, /* close */
NULL, /* fstat */
diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h
index ad9c541f1d..061f8720d9 100644
--- a/main/streams/php_stream_filter_api.h
+++ b/main/streams/php_stream_filter_api.h
@@ -106,7 +106,7 @@ typedef struct _php_stream_filter_chain {
} php_stream_filter_chain;
struct _php_stream_filter {
- php_stream_filter_ops *fops;
+ const php_stream_filter_ops *fops;
zval abstract; /* for use by filter implementation */
php_stream_filter *next;
php_stream_filter *prev;
@@ -131,7 +131,7 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish);
PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor);
PHPAPI void php_stream_filter_free(php_stream_filter *filter);
-PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, uint8_t persistent STREAMS_DC);
+PHPAPI php_stream_filter *_php_stream_filter_alloc(const php_stream_filter_ops *fops, void *abstract, uint8_t persistent STREAMS_DC);
END_EXTERN_C()
#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC)
#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC)
@@ -146,9 +146,9 @@ typedef struct _php_stream_filter_factory {
} php_stream_filter_factory;
BEGIN_EXTERN_C()
-PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory);
+PHPAPI int php_stream_filter_register_factory(const char *filterpattern, const php_stream_filter_factory *factory);
PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern);
-PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpattern, php_stream_filter_factory *factory);
+PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpattern, const php_stream_filter_factory *factory);
PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, uint8_t persistent);
END_EXTERN_C()
diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h
index cf3492cf6f..1eb2d8b0ca 100644
--- a/main/streams/php_stream_glob_wrapper.h
+++ b/main/streams/php_stream_glob_wrapper.h
@@ -18,8 +18,8 @@
/* $Id$ */
-PHPAPI extern php_stream_wrapper php_glob_stream_wrapper;
-PHPAPI extern php_stream_ops php_glob_stream_ops;
+PHPAPI extern php_stream_wrapper php_glob_stream_wrapper;
+PHPAPI extern const php_stream_ops php_glob_stream_ops;
BEGIN_EXTERN_C()
diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h
index 8a8834dfba..951f8764a6 100644
--- a/main/streams/php_stream_userspace.h
+++ b/main/streams/php_stream_userspace.h
@@ -20,8 +20,8 @@
/* for user-space streams */
-PHPAPI extern php_stream_ops php_stream_userspace_ops;
-PHPAPI extern php_stream_ops php_stream_userspace_dir_ops;
+PHPAPI extern const php_stream_ops php_stream_userspace_ops;
+PHPAPI extern const php_stream_ops php_stream_userspace_dir_ops;
#define PHP_STREAM_IS_USERSPACE &php_stream_userspace_ops
#define PHP_STREAM_IS_USERSPACE_DIR &php_stream_userspace_dir_ops
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index a5429138f3..33f425f812 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -881,6 +881,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
}
}
+/* This should be "const", but phpdbg overwrite it */
PHPAPI php_stream_ops php_stream_stdio_ops = {
php_stdiop_write, php_stdiop_read,
php_stdiop_close, php_stdiop_flush,
@@ -923,7 +924,7 @@ static int php_plain_files_dirstream_rewind(php_stream *stream, zend_off_t offse
return 0;
}
-static php_stream_ops php_plain_files_dirstream_ops = {
+static const php_stream_ops php_plain_files_dirstream_ops = {
NULL, php_plain_files_dirstream_read,
php_plain_files_dirstream_close, NULL,
"dir",
@@ -1409,7 +1410,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
}
-static php_stream_wrapper_ops php_plain_files_wrapper_ops = {
+static const php_stream_wrapper_ops php_plain_files_wrapper_ops = {
php_plain_files_stream_opener,
NULL,
NULL,
diff --git a/main/streams/streams.c b/main/streams/streams.c
index c97ebd0239..cf334cb4df 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -267,7 +267,7 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option
/* }}} */
/* allocate a new stream for a particular ops */
-PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC) /* {{{ */
+PHPAPI php_stream *_php_stream_alloc(const php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC) /* {{{ */
{
php_stream *ret;
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index 59dddfd42d..893820cb90 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -55,7 +55,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i
static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode,
int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
-static php_stream_wrapper_ops user_stream_wops = {
+static const php_stream_wrapper_ops user_stream_wops = {
user_wrapper_opener,
NULL, /* close - the streams themselves know how */
NULL, /* stat - the streams themselves know how */
@@ -1542,7 +1542,7 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr)
return ret;
}
-php_stream_ops php_stream_userspace_ops = {
+const php_stream_ops php_stream_userspace_ops = {
php_userstreamop_write, php_userstreamop_read,
php_userstreamop_close, php_userstreamop_flush,
"user-space",
@@ -1552,7 +1552,7 @@ php_stream_ops php_stream_userspace_ops = {
php_userstreamop_set_option,
};
-php_stream_ops php_stream_userspace_dir_ops = {
+const php_stream_ops php_stream_userspace_dir_ops = {
NULL, /* write */
php_userstreamop_readdir,
php_userstreamop_closedir,
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 57e2f22fba..bca06d0bc8 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -46,12 +46,12 @@
# define XP_SOCK_BUF_SIZE(sz) (sz)
#endif
-php_stream_ops php_stream_generic_socket_ops;
-PHPAPI php_stream_ops php_stream_socket_ops;
-php_stream_ops php_stream_udp_socket_ops;
+const php_stream_ops php_stream_generic_socket_ops;
+PHPAPI const php_stream_ops php_stream_socket_ops;
+const php_stream_ops php_stream_udp_socket_ops;
#ifdef AF_UNIX
-php_stream_ops php_stream_unix_socket_ops;
-php_stream_ops php_stream_unixdg_socket_ops;
+const php_stream_ops php_stream_unix_socket_ops;
+const php_stream_ops php_stream_unixdg_socket_ops;
#endif
@@ -484,7 +484,7 @@ static int php_sockop_cast(php_stream *stream, int castas, void **ret)
* A "useful" side-effect is that the user's scripts can then
* make similar decisions using stream_get_meta_data.
* */
-php_stream_ops php_stream_generic_socket_ops = {
+const php_stream_ops php_stream_generic_socket_ops = {
php_sockop_write, php_sockop_read,
php_sockop_close, php_sockop_flush,
"generic_socket",
@@ -495,7 +495,7 @@ php_stream_ops php_stream_generic_socket_ops = {
};
-php_stream_ops php_stream_socket_ops = {
+const php_stream_ops php_stream_socket_ops = {
php_sockop_write, php_sockop_read,
php_sockop_close, php_sockop_flush,
"tcp_socket",
@@ -505,7 +505,7 @@ php_stream_ops php_stream_socket_ops = {
php_tcp_sockop_set_option,
};
-php_stream_ops php_stream_udp_socket_ops = {
+const php_stream_ops php_stream_udp_socket_ops = {
php_sockop_write, php_sockop_read,
php_sockop_close, php_sockop_flush,
"udp_socket",
@@ -516,7 +516,7 @@ php_stream_ops php_stream_udp_socket_ops = {
};
#ifdef AF_UNIX
-php_stream_ops php_stream_unix_socket_ops = {
+const php_stream_ops php_stream_unix_socket_ops = {
php_sockop_write, php_sockop_read,
php_sockop_close, php_sockop_flush,
"unix_socket",
@@ -525,7 +525,7 @@ php_stream_ops php_stream_unix_socket_ops = {
php_sockop_stat,
php_tcp_sockop_set_option,
};
-php_stream_ops php_stream_unixdg_socket_ops = {
+const php_stream_ops php_stream_unixdg_socket_ops = {
php_sockop_write, php_sockop_read,
php_sockop_close, php_sockop_flush,
"udg_socket",
@@ -883,7 +883,7 @@ PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t p
{
php_stream *stream = NULL;
php_netstream_data_t *sock;
- php_stream_ops *ops;
+ const php_stream_ops *ops;
/* which type of socket ? */
if (strncmp(proto, "tcp", protolen) == 0) {