Re: cvs: php4 /ext/mysql php_mysql.c php_mysql.h

From: Date: Mon, 07 May 2001 14:17:22 +0000
Subject: Re: cvs: php4 /ext/mysql php_mysql.c php_mysql.h
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5586@lists.php.net to get a copy of this message
Thanks for catching that Zeev, I don't know what I was thinking : ) -Jason ----- Original Message ----- From: "Zeev Suraski" <zeev@zend.com> To: <php-cvs@lists.php.net> Sent: Friday, May 04, 2001 8:42 PM Subject: [PHP-CVS] cvs: php4 /ext/mysql php_mysql.c php_mysql.h > zeev Fri May 4 18:42:15 2001 EDT > > Modified files: > /php4/ext/mysql php_mysql.c php_mysql.h > Log: > emalloc()'d strings must be freed before the request shutdown; > Rule of the thumb: initialize in RINIT, clean in RSHUTDOWN > > > Index: php4/ext/mysql/php_mysql.c > diff -u php4/ext/mysql/php_mysql.c:1.81 php4/ext/mysql/php_mysql.c:1.82 > --- php4/ext/mysql/php_mysql.c:1.81 Fri May 4 11:27:15 2001 > +++ php4/ext/mysql/php_mysql.c Fri May 4 18:42:15 2001 > @@ -16,7 +16,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: php_mysql.c,v 1.81 2001/05/04 18:27:15 jason Exp $ */ > +/* $Id: php_mysql.c,v 1.82 2001/05/05 01:42:15 zeev Exp $ */ > > > /* TODO: > @@ -173,7 +173,7 @@ > }; > > zend_module_entry mysql_module_entry = { > - "mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), > NULL, > + "mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), > PHP_RSHUTDOWN(mysql), > PHP_MINFO(mysql), STANDARD_MODULE_PROPERTIES > }; > > @@ -323,11 +323,17 @@ > MySG(default_link)=-1; > MySG(num_links) = MySG(num_persistent); > /* Reset connect error/errno on every request */ > + MySG(connect_error) = NULL; > + MySG(connect_errno)=0; > + return SUCCESS; > +} > + > + > +PHP_RSHUTDOWN_FUNCTION(mysql) > +{ > if (MySG(connect_error)!=NULL) { > efree(MySG(connect_error)); > - MySG(connect_error)=NULL; > } > - MySG(connect_errno)=0; > return SUCCESS; > } > > Index: php4/ext/mysql/php_mysql.h > diff -u php4/ext/mysql/php_mysql.h:1.20 php4/ext/mysql/php_mysql.h:1.21 > --- php4/ext/mysql/php_mysql.h:1.20 Thu May 3 18:14:26 2001 > +++ php4/ext/mysql/php_mysql.h Fri May 4 18:42:15 2001 > @@ -17,7 +17,7 @@ > */ > > > -/* $Id: php_mysql.h,v 1.20 2001/05/04 01:14:26 jason Exp $ */ > +/* $Id: php_mysql.h,v 1.21 2001/05/05 01:42:15 zeev Exp $ */ > > #ifndef PHP_MYSQL_H > #define PHP_MYSQL_H > @@ -41,6 +41,7 @@ > extern PHP_MINIT_FUNCTION(mysql); > extern PHP_RINIT_FUNCTION(mysql); > extern PHP_MSHUTDOWN_FUNCTION(mysql); > +extern PHP_RSHUTDOWN_FUNCTION(mysql); > PHP_MINFO_FUNCTION(mysql); > > PHP_FUNCTION(mysql_connect); > > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net > For additional commands, e-mail: php-cvs-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.cvs (#5586) next »