summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bf_null.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-02-20 23:43:02 +0000
committerRichard Levitte <levitte@openssl.org>2000-02-20 23:43:02 +0000
commitd3442bc780473f0cd4f378bc31130d4579da640b (patch)
treea9e0e2f1ba5080829e22783c739a9cacaa95ebd5 /crypto/bio/bf_null.c
parentdab6f09573742df94c4767663565aca3863f8173 (diff)
Move the registration of callback functions to special functions
designed for that. This removes the potential error to mix data and function pointers. Please note that I'm a little unsure how incorrect calls to the old ctrl functions should be handled, in som cases. I currently return 0 and that's it, but it may be more correct to generate a genuine error in those cases.
Diffstat (limited to 'crypto/bio/bf_null.c')
-rw-r--r--crypto/bio/bf_null.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c
index 3254a55dce..0d183a6d9a 100644
--- a/crypto/bio/bf_null.c
+++ b/crypto/bio/bf_null.c
@@ -72,6 +72,7 @@ static int nullf_gets(BIO *h,char *str,int size);
static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2);
static int nullf_new(BIO *h);
static int nullf_free(BIO *data);
+static long nullf_callback_ctrl(BIO *h,int cmd,void (*fp)());
static BIO_METHOD methods_nullf=
{
BIO_TYPE_NULL_FILTER,
@@ -83,6 +84,7 @@ static BIO_METHOD methods_nullf=
nullf_ctrl,
nullf_new,
nullf_free,
+ nullf_callback_ctrl,
};
BIO_METHOD *BIO_f_null(void)
@@ -152,6 +154,20 @@ static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr)
return(ret);
}
+static long nullf_callback_ctrl(BIO *b, int cmd, void (*fp)())
+ {
+ long ret=1;
+
+ if (b->next_bio == NULL) return(0);
+ switch (cmd)
+ {
+ default:
+ ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
+ break;
+ }
+ return(ret);
+ }
+
static int nullf_gets(BIO *bp, char *buf, int size)
{
if (bp->next_bio == NULL) return(0);