Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81981 invoked by uid 1010); 4 Dec 2003 10:58:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 81956 invoked from network); 4 Dec 2003 10:58:05 -0000 Received: from unknown (HELO prv-mail25.provo.novell.com) (137.65.81.121) by pb1.pair.com with SMTP; 4 Dec 2003 10:58:05 -0000 Received: from INET-PRV1-MTA by prv-mail25.provo.novell.com with Novell_GroupWise; Thu, 04 Dec 2003 03:58:05 -0700 Message-ID: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Beta Date: Thu, 04 Dec 2003 03:57:44 -0700 To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Question on SG(server_context) in sapi_apache2.c From: hyanantha@novell.com ("Ananth Kesari") Hi, As some of you may know, I am working of porting PHP onto NetWare. I find this in sapi_apache2.c code: In the "php_post_read_request" function, we register a cleanup function called "php_server_context_cleanup" to clear clear out the "SG(server_context)" after each request. We pass the pointer of this variable to the cleanup function. The comment says that this is done to cater to those cases where this is handled by a different thread. Now, in the "php_server_context_cleanup" function, we just put this value to NULL. Now my questions are: 1. Why should we explicitly make SG(server_context) to NULL at the end of every request? What is the purpose of this operation? Doesn't this variable get assigned to NULL at the start of each request? In that case there is nothing to do in the "php_server_context_cleanup" function. 2. If the "php_server_context_cleanup" function is required, then what is inside this function, isn't this equivalent to making SG(server_context) = NULL in the "php_server_context_cleanup" function? If this so, they why pass the pointer of this variable - why not assign is directly to NULL. Then the "php_server_context_cleanup" function looks like this: TSRMLS_FETCH(); SG(server_context) = NULL; Can you throw some light on this? Thanks, Ananth.