tpop3d-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tpop3d-discuss]Database connection


From: ohp
Subject: Re: [tpop3d-discuss]Database connection
Date: Wed, 30 Nov 2005 15:52:51 +0100 (MET)

Many thanks Daniel for your help
Attachedc is the patch I made that seems to work quit well
Hope it helps.

Best regards
On Wed, 30 Nov 2005, Daniel Tiefnig wrote:

> Date: Wed, 30 Nov 2005 11:36:09 +0100
> From: Daniel Tiefnig <address@hidden>
> To: address@hidden
> Subject: Re: [tpop3d-discuss]Database connection
>
> address@hidden wrote:
> > Would  it be hard to add kindda ping to see if connection is alive et
> >  reconnect to it in case not?
>
> Sure not.
>
> > Where should I look to add such a beast?
>
> auth_pgsql.c would be the place to implement this. There are three calls
> to PQexec in this file. (one in each of auth_pgsql_new_apop,
> auth_pgsql_new_user_pass and auth_pgsql_onlogin) You could call
> PQstatus() after a query failed, followed by PQreset() if status is not
> "CONNECTION_OK". After that you may want to retry your query, so this
> could be put into a loop, but take care to don't loop forever. Kind of 3
> retries should be sufficient, with a little sleep between them.
> Maybe it would be the best to put the calls to PQexec() inside a
> function (like "do_PQexec" or something) so this hasn't to be
> implemented three times.
>
> If you need help to implement this, feel free to ask. I don't have much
> spare time at the moment, but I'll do what I can.
>
> The pgsql C API is explained at
> http://www.postgresql.org/docs/7.4/interactive/libpq.html
> It has lots of usefull information and also some sample programs.
>
>
> lg,
> daniel
>
> _______________________________________________
> tpop3d-discuss mailing list
> address@hidden
> http://lists.beasts.org/mailman/listinfo/tpop3d-discuss
>
>

-- 
Olivier PRENANT                 Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges                +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: address@hidden
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

Attachment: tpop3d.diff
Description: auth_pgsql.diff-c


reply via email to

[Prev in Thread] Current Thread [Next in Thread]