diff options
Diffstat (limited to 'APM-upstream.patch')
-rw-r--r-- | APM-upstream.patch | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/APM-upstream.patch b/APM-upstream.patch new file mode 100644 index 0000000..5d30be7 --- /dev/null +++ b/APM-upstream.patch @@ -0,0 +1,101 @@ +From 922a92ba1f0fd0b771082b8d998003ebd60415e9 Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Tue, 10 Mar 2015 08:18:34 +0100 +Subject: [PATCH] fix version reported in reflection + +--- + apm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/apm.c b/apm.c +index 8fae308..b9ddb51 100644 +--- a/apm.c ++++ b/apm.c +@@ -115,7 +115,7 @@ zend_module_entry apm_module_entry = { + PHP_RSHUTDOWN(apm), + PHP_MINFO(apm), + #if ZEND_MODULE_API_NO >= 20010901 +- "0.1.0", ++ PHP_APM_VERSION, + #endif + PHP_MODULE_GLOBALS(apm), + PHP_GINIT(apm), +From c26e0d88df157f1ac5386c15036023f6954fd2c4 Mon Sep 17 00:00:00 2001 +From: Patrick Allaert <pa@ez.no> +Date: Tue, 10 Mar 2015 16:33:31 +0100 +Subject: [PATCH] Fixed: global 'apm.enabled' switch not taken into account + everywhere (thx @remicollet) + +--- + driver_socket.c | 2 +- + driver_sqlite3.c | 14 ++++++++------ + driver_statsd.c | 8 ++++++++ + 3 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/driver_socket.c b/driver_socket.c +index 39daca5..40fcdd4 100644 +--- a/driver_socket.c ++++ b/driver_socket.c +@@ -115,7 +115,7 @@ int apm_driver_socket_rshutdown(TSRMLS_D) + struct addrinfo hints, *servinfo; + char host[1024], *port; + +- if (!APM_G(socket_enabled)) { ++ if (!(APM_G(enabled) && APM_G(socket_enabled))) { + return SUCCESS; + } + +diff --git a/driver_sqlite3.c b/driver_sqlite3.c +index 4b0c4ef..f9bbe10 100644 +--- a/driver_sqlite3.c ++++ b/driver_sqlite3.c +@@ -74,15 +74,17 @@ static int perform_db_access_checks(const char *path TSRMLS_DC) + + PHP_INI_MH(OnUpdateDBFile) + { +- if (new_value && new_value_length > 0) { +- snprintf(APM_G(sqlite3_db_file), MAXPATHLEN, "%s/%s", new_value, DB_FILE); +- disconnect(TSRMLS_C); ++ if (APM_G(enabled) && APM_G(sqlite3_enabled)) { ++ if (new_value && new_value_length > 0) { ++ snprintf(APM_G(sqlite3_db_file), MAXPATHLEN, "%s/%s", new_value, DB_FILE); ++ disconnect(TSRMLS_C); + +- if (perform_db_access_checks(new_value TSRMLS_CC) == FAILURE) { ++ if (perform_db_access_checks(new_value TSRMLS_CC) == FAILURE) { ++ APM_G(sqlite3_enabled) = 0; ++ } ++ } else { + APM_G(sqlite3_enabled) = 0; + } +- } else { +- APM_G(sqlite3_enabled) = 0; + } + return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } +diff --git a/driver_statsd.c b/driver_statsd.c +index a92c80a..4527d5e 100644 +--- a/driver_statsd.c ++++ b/driver_statsd.c +@@ -110,6 +110,10 @@ int apm_driver_statsd_minit(int module_number TSRMLS_DC) + struct addrinfo hints; + char port[8]; + ++ if (!(APM_G(enabled) && APM_G(statsd_enabled))) { ++ return SUCCESS; ++ } ++ + memset(&hints, 0, sizeof hints); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_DGRAM; +@@ -129,6 +133,10 @@ int apm_driver_statsd_rinit(TSRMLS_D) + + int apm_driver_statsd_mshutdown(SHUTDOWN_FUNC_ARGS) + { ++ if (!(APM_G(enabled) && APM_G(statsd_enabled))) { ++ return SUCCESS; ++ } ++ + freeaddrinfo(APM_G(statsd_servinfo)); + + return SUCCESS; |