Here are the patch (crypto/err), have been generated from
openssl-SNAP-20030612:
added: "int disabled;" to ERR_STATE and the following functions:
- ERR_disable
- ERR_enable
- ERR_force_enable (since I'm using a counter, it might be necessary)
- ERR_get_lock_status
- ERR_set_lock_status

The functions "ERR_force_enable", "ERR_get_lock_status" and
"ERR_set_lock_status" have been added for the following case of use:

...
ERR_disable();
foo1();
ERR_enable();
...

void foo1()
{
...
ERR_disable();
foo2();
ERR_enable();
...
}

void foo2() //This function absolutely needs some error feedback
{
int err_status;
...
err_status = ERR_get_lock_status();
ERR_force_enable();
ERR_print_errors_fp(stderr);
ERR_set_lock_status(err_status);
...
}

That's pretty much all I need for error disabling, nothing too fancy like
disabling errors handling for all threads contexts.

Frédéric Giudicelli
http://www.newpki.org


----- Original Message ----- 
From: "Richard Levitte - VMS Whacker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 12, 2003 12:33 AM
Subject: Re: [openssl.org #629] Custom error handling


> In message <[EMAIL PROTECTED]> on Thu, 12 Jun 2003
00:22:28 +0200, Frédéric Giudicelli <[EMAIL PROTECTED]> said:
>
> groups> Ok, I'll wait for you to tell me when the update on the error
> groups> handling will be done, I'll take it from there.
>
> If you mean to ask for when the new functions ERR_set_mark() and
> ERR_pop_to_mark() will be committed, they already are.  They will be
> visible in tomorrow's snapshot.
>
> -- 
> Richard Levitte   \ Tunnlandsvägen 3  \ [EMAIL PROTECTED]
> [EMAIL PROTECTED]  \ S-168 36  BROMMA  \ T: +46-8-26 52 47
>                     \      SWEDEN       \ or +46-708-26 53 44
> Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
> Member of the OpenSSL development team: http://www.openssl.org/
>
> Unsolicited commercial email is subject to an archival fee of $400.
> See <http://www.stacken.kth.se/~levitte/mail/> for more info.
>

Attachment: err.h.patch
Description: Binary data

Attachment: err.c.patch
Description: Binary data

Reply via email to