summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
committerOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
commitf40f1ce174885cd0f526c003eca3fa523e0ef269 (patch)
treece22a7abe1212824c0be6bace0eb49de7249f9f9 /main
parent1dc5de7731d1bc41002f9b58f798e93f393e6f08 (diff)
downloadphp-f40f1ce174885cd0f526c003eca3fa523e0ef269.tar.gz
New upstream version 5.6.3+dfsgupstream/5.6.3+dfsg
Diffstat (limited to 'main')
-rw-r--r--main/getopt.c8
-rw-r--r--main/output.c2
-rw-r--r--main/php_config.h.in3
-rw-r--r--main/php_main.h3
-rw-r--r--main/php_output.h2
-rw-r--r--main/php_version.h6
-rw-r--r--main/snprintf.c4
-rw-r--r--main/snprintf.h4
-rw-r--r--main/streams/plain_wrapper.c28
9 files changed, 49 insertions, 11 deletions
diff --git a/main/getopt.c b/main/getopt.c
index a31a6c75d..258173fc2 100644
--- a/main/getopt.c
+++ b/main/getopt.c
@@ -59,9 +59,17 @@ PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char
{
static int optchr = 0;
static int dash = 0; /* have already seen the - */
+ static char **prev_optarg = NULL;
php_optidx = -1;
+ if(prev_optarg && prev_optarg != optarg) {
+ /* reset the state */
+ optchr = 0;
+ dash = 0;
+ }
+ prev_optarg = optarg;
+
if (*optind >= argc) {
return(EOF);
}
diff --git a/main/output.c b/main/output.c
index 1dac7179b..0c7212ac9 100644
--- a/main/output.c
+++ b/main/output.c
@@ -35,7 +35,7 @@
#include "zend_stack.h"
#include "php_output.h"
-ZEND_DECLARE_MODULE_GLOBALS(output);
+PHPAPI ZEND_DECLARE_MODULE_GLOBALS(output);
const char php_output_default_handler_name[sizeof("default output handler")] = "default output handler";
const char php_output_devnull_handler_name[sizeof("null output handler")] = "null output handler";
diff --git a/main/php_config.h.in b/main/php_config.h.in
index 00246a920..25726c486 100644
--- a/main/php_config.h.in
+++ b/main/php_config.h.in
@@ -2399,6 +2399,9 @@
/* Define if cross-process locking is required by accept() */
#undef USE_LOCKING
+/* Use system default cipher list instead of hardcoded value */
+#undef USE_OPENSSL_SYSTEM_CIPHERS
+
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
diff --git a/main/php_main.h b/main/php_main.h
index 1325486bd..03c89c5d6 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -50,9 +50,6 @@ PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC);
PHPAPI void php_html_puts(const char *str, uint siz TSRMLS_DC);
PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC);
-extern void php_call_shutdown_functions(TSRMLS_D);
-extern void php_free_shutdown_functions(TSRMLS_D);
-
/* environment module */
extern int php_init_environ(void);
extern int php_shutdown_environ(void);
diff --git a/main/php_output.h b/main/php_output.h
index 0312e256f..3831478b9 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -152,6 +152,8 @@ ZEND_BEGIN_MODULE_GLOBALS(output)
int output_start_lineno;
ZEND_END_MODULE_GLOBALS(output)
+PHPAPI ZEND_EXTERN_MODULE_GLOBALS(output);
+
/* there should not be a need to use OG() from outside of output.c */
#ifdef ZTS
# define OG(v) TSRMG(output_globals_id, zend_output_globals *, v)
diff --git a/main/php_version.h b/main/php_version.h
index 0ae6fc698..5134679e1 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 6
-#define PHP_RELEASE_VERSION 2
+#define PHP_RELEASE_VERSION 3
#define PHP_EXTRA_VERSION ""
-#define PHP_VERSION "5.6.2"
-#define PHP_VERSION_ID 50602
+#define PHP_VERSION "5.6.3"
+#define PHP_VERSION_ID 50603
diff --git a/main/snprintf.c b/main/snprintf.c
index 1c73dcdcb..2a452ef1f 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -311,7 +311,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
/* char * ap_php_conv_10() {{{ */
-char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
+PHPAPI char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
register bool_int * is_negative, char *buf_end, register int *len)
{
register char *p = buf_end;
@@ -474,7 +474,7 @@ PHPAPI char * php_conv_fp(register char format, register double num,
* which is a pointer to the END of the buffer + 1 (i.e. if the buffer
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
-char * ap_php_conv_p2(register u_wide_int num, register int nbits, char format, char *buf_end, register int *len) /* {{{ */
+PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits, char format, char *buf_end, register int *len) /* {{{ */
{
register int mask = (1 << nbits) - 1;
register char *p = buf_end;
diff --git a/main/snprintf.h b/main/snprintf.h
index 10f0e24fa..f44659322 100644
--- a/main/snprintf.h
+++ b/main/snprintf.h
@@ -152,10 +152,10 @@ typedef enum {
typedef WIDE_INT wide_int;
typedef unsigned WIDE_INT u_wide_int;
-extern char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
+PHPAPI char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
register bool_int * is_negative, char *buf_end, register int *len);
-extern char * ap_php_conv_p2(register u_wide_int num, register int nbits,
+PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits,
char format, char *buf_end, register int *len);
/* The maximum precision that's allowed for float conversion. Does not include
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 87312b9ef..69c6a3ce2 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -342,6 +342,34 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
assert(data != NULL);
if (data->fd >= 0) {
+#ifdef PHP_WIN32
+ php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract;
+
+ if (self->is_pipe || self->is_process_pipe) {
+ HANDLE ph = (HANDLE)_get_osfhandle(data->fd);
+ int retry = 0;
+ DWORD avail_read = 0;
+
+ do {
+ /* Look ahead to get the available data amount to read. Do the same
+ as read() does, however not blocking forever. In case it failed,
+ no data will be read (better than block). */
+ if (!PeekNamedPipe(ph, NULL, 0, NULL, &avail_read, NULL)) {
+ break;
+ }
+ /* If there's nothing to read, wait in 100ms periods. */
+ if (0 == avail_read) {
+ usleep(100000);
+ }
+ } while (0 == avail_read && retry++ < 320);
+
+ /* Reduce the required data amount to what is available, otherwise read()
+ will block.*/
+ if (avail_read < count) {
+ count = avail_read;
+ }
+ }
+#endif
ret = read(data->fd, buf, count);
if (ret == (size_t)-1 && errno == EINTR) {