php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72645
Patch patch-opcache-use-iis-pool-name revision 2017-08-28 07:40 UTC by snt dot kamikaze at yahoo dot com
revision 2016-07-22 07:48 UTC by pvasilevich at plesk dot com

Patch patch-opcache-use-iis-pool-name for opcache Bug #72645

Patch version 2017-08-28 07:40 UTC

Return to Bug #72645 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: snt.kamikaze@yahoo.com

--- ext/opcache/shared_alloc_win32.c	Wed Jul 13 08:57:00 2016
+++ ext/opcache/shared_alloc_win32.c	Fri Jul 22 01:32:58 2016
@@ -79,9 +79,12 @@
 	static char newname[MAXPATHLEN + UNLEN + 4];
 	char uname[UNLEN + 1];
 	DWORD unsize = UNLEN;
+	char* pool_id;
 
 	GetUserName(uname, &unsize);
-	snprintf(newname, sizeof(newname) - 1, "%s@%s", name, uname);
+
+	pool_id = getenv("APP_POOL_ID");
+	snprintf(newname, sizeof(newname) - 1, "%s@%s%s%s", name, uname, pool_id != NULL ? "@" : "", pool_id != NULL ? pool_id : "");
 	return newname;
 }
 
@@ -91,11 +94,14 @@
 	char uname[UNLEN + 1];
 	DWORD unsize = UNLEN;
 	int l;
+	char* pool_id;
 
 	GetTempPath(MAXPATHLEN, windir);
 	GetUserName(uname, &unsize);
 	l = strlen(windir);
-	snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s", ACCEL_FILEMAP_BASE, uname);
+
+	pool_id = getenv("APP_POOL_ID");
+	snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s%s%s", ACCEL_FILEMAP_BASE, uname, pool_id != NULL ? "@" : "", pool_id != NULL ? pool_id : "");
 	return windir;
 }
 
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jan 21 00:03:33 2022 UTC