php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51118
Patch php-syslog.v4.patch.txt revision 2011-07-05 13:31 UTC by fat@php.net
Patch php-syslog.patch revision 2011-01-30 13:31 UTC by fat@php.net
revision 2011-01-30 13:23 UTC by fat@php.net
revision 2011-01-30 10:58 UTC by fat@php.net
Patch php_syslog_multiple_context.patch revision 2011-01-29 13:02 UTC by fat@php.net
revision 2010-07-23 03:23 UTC by fat@php.net

Patch php_syslog_multiple_context.patch for *General Issues Bug #51118

Patch version 2011-01-29 13:02 UTC

Return to Bug #51118 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2011-01-29 13:02 UTC | 2010-07-23 03:23 UTC

Developer: fat@php.net


 Index: syslog.c
 Index: ext/standard/syslog.c
  ===================================================================
 
 +++ syslog.c	(copie de travail)
 
 +++ ext/standard/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 (strcmp(context->ident, BG(syslog_device)) != 0) {
 +		if (context && 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 (BG(syslog_device) == NULL || strcmp(BG(syslog_device), context->ident) != 0) {
 +		if (context && (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: php_ext_syslog.h
 Index: ext/standard/php_ext_syslog.h
  ===================================================================
 
 +++ php_ext_syslog.h	(copie de travail)
 
 +++ ext/standard/php_ext_syslog.h	(copie de travail)
  @@ -25,6 +25,14 @@
   
   #include "php_syslog.h"
   
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC