diff options
author | Xinchen Hui <laruence@gmail.com> | 2015-05-27 16:36:15 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2015-05-27 16:36:15 +0800 |
commit | 90df7e75e6b1ca301d053cbe6d1dee66c586ecb8 (patch) | |
tree | 6a67cd0bbfe9f85253c59d695c42c119f3978c7a /sapi/phpdbg | |
parent | f972e219e477fa1f4137de2de24e05c0f5c515e1 (diff) | |
parent | f68dc94aa727085040650b4c9354672f2f62ee6a (diff) | |
download | php-git-90df7e75e6b1ca301d053cbe6d1dee66c586ecb8.tar.gz |
Merge branch 'master' into merge-fastcgi
Conflicts:
sapi/fpm/fpm/fpm_main.c
Diffstat (limited to 'sapi/phpdbg')
-rw-r--r-- | sapi/phpdbg/phpdbg_io.c | 10 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_print.c | 8 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_utils.c | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index 1f004fbae1..47899abf66 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -178,11 +178,19 @@ PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) { PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { + int ret; + if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_consume_bytes(sock, ptr, len, tmo); } - return read(sock, ptr, len); + ret = read(sock, ptr, len); + if (ret == -1 && errno == EINTR) { + /* Read was interrupted, retry once */ + ret = read(sock, ptr, len); + } + + return ret; } diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 11bfdf5a81..4013c0fd88 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -282,12 +282,13 @@ void phpdbg_print_opcodes_function(const char *function, size_t len) { } void phpdbg_print_opcodes_method(const char *class, const char *function) { - zend_class_entry *ce = zend_hash_str_find_ptr(EG(class_table), class, strlen(class)); + zend_class_entry *ce; zend_function *func; - if (!ce) { + if (phpdbg_safe_class_lookup(class, strlen(class), &ce) != SUCCESS) { return; } + if (ce->type != ZEND_USER_CLASS) { phpdbg_out("function name: %s::%s (internal)\n", class, function); return; @@ -348,7 +349,6 @@ void phpdbg_print_opcodes_class(const char *class) { PHPDBG_API void phpdbg_print_opcodes(char *function) { char *method_name; - strtok(function, ":"); if (function == NULL) { @@ -376,7 +376,7 @@ PHPDBG_API void phpdbg_print_opcodes(char *function) } ZEND_HASH_FOREACH_END(); } else if ((method_name = strtok(NULL, ":")) == NULL) { phpdbg_print_opcodes_function(function, strlen(function)); - } else if (++method_name == NULL || ++method_name == NULL) { + } else if ((method_name + 1) == NULL) { phpdbg_print_opcodes_class(function); } else { phpdbg_print_opcodes_method(function, method_name); diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index 9d63fcf727..4cd8ce2782 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -384,7 +384,7 @@ int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry efree(str_name); } - return ce ? SUCCESS : FAILURE; + return *ce ? SUCCESS : FAILURE; } char *phpdbg_get_property_key(char *key) { |