I don't know how many people would desire this behaviour. but I think it
should be considered.

in vmysql.c I added the following lines to vauth_open_update()

uint timeout = 1;
mysql_options(&mysql_update, MYSQL_OPT_CONNECT_TIMEOUT, (char*) &timeout);

this adds a timeout to the mysql_real_connect method.
without this libmysqlclient uses the standard connect() to connect
which, under heavy load, can take minutes to timeout, the effect is that
if the update server was to become unavailable your pop concurency would
max out very quickly, effectively a loss of service.

also you would want to remove the error lines:

fprintf(stderr, "could not connect to mysql update server %s with database\n",
              mysql_error(&mysql_update));

and

fprintf(stderr, "could not connect to mysql update server %s\n",
              mysql_error(&mysql_update));

because some pop clients break if they receive anything other than the
ok after auth.

Reply via email to