php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch php_syslog_multiple_context.patch for *General Issues Bug #51118Patch version 2010-07-23 03:23 UTC Return to Bug #51118 | Download this patchThis patch is obsolete Obsoleted by patches:
Developer: fat@php.netIndex: ext/standard/syslog.c Index: syslog.c =================================================================== --- ext/standard/syslog.c (r�vision 307840) +++ ext/standard/syslog.c (copie de travail) --- syslog.c (r�vision 301478) +++ syslog.c (copie de travail) @@ -36,10 +36,26 @@ #include "basic_functions.h" #include "php_ext_syslog.h" - free(BG(syslog_device)); - BG(syslog_device)=NULL; + if (zcontext) { + ZEND_FETCH_RESOURCE(context, php_syslog_context*, &zcontext, -1, PHP_SYSLOG_RES_NAME, le_syslog); + if (context && strcmp(context->ident, BG(syslog_device)) != 0) { + if (strcmp(context->ident, BG(syslog_device)) != 0) { + close = 0; + } + zend_list_delete(Z_LVAL_P(zcontext)); } } + if (zcontext) { + ZEND_FETCH_RESOURCE(context, php_syslog_context*, &zcontext, -1, PHP_SYSLOG_RES_NAME, le_syslog); + if (context && (BG(syslog_device) == NULL || strcmp(BG(syslog_device), context->ident) != 0)) { + if (BG(syslog_device) == NULL || strcmp(BG(syslog_device), context->ident) != 0) { + if (BG(syslog_device)) { + free(BG(syslog_device)); + } + BG(syslog_device) = zend_strndup(context->ident, strlen(context->ident)); + php_syslog(priority, "%s", message); RETURN_TRUE; } Index: ext/standard/php_ext_syslog.h Index: php_ext_syslog.h =================================================================== --- ext/standard/php_ext_syslog.h (r�vision 307840) +++ ext/standard/php_ext_syslog.h (copie de travail) --- php_ext_syslog.h (r�vision 301478) +++ php_ext_syslog.h (copie de travail) @@ -25,6 +25,14 @@ #include "php_syslog.h" |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Wed Dec 04 18:01:31 2024 UTC |