hi:
I have written a patch for vmysql.c,if 'read_open' is 1,but mysql server have close this connection,vpopmail will report error: "MySQL server has gone away" . Mysql_ping checks whether the connection to the server is working. If the connection have closed, then reconnec.
============PATCH=======================
diff -u vpopmail-5.4.13.org/vmysql.c vpopmail-5.4.13/vmysql.c
---
vpopmail-5.4.13.org/vmysql.c 2004-12-16 23:57:34.000000000 +0800
+++ vpopmail-5.4.13/vmysql.c 2006-03-30 21:29:40.000000000 +0800
@@ -238,7 +238,7 @@
int vauth_open_read()
{
/* if we are already connected, just return */
- if ( read_open != 0 ) return(0);
+ if ( read_open && (mysql_ping(&mysql_read)==0) ) return(0);
read_open = 1;
/* connect to mysql and set the database */
=================END================
------------------------------------
Jianbin Xiao
Comsenz Technology Ltd
--
===========================
DQPI Polaris BBS
Martin Xiao
===========================
- [vchkpw] patch for vmysql.c Martin Xiao
- [vchkpw] Re: patch for vmysql.c Martin Xiao