diff options
author | Bodo Möller <bodo@openssl.org> | 2000-09-05 12:35:00 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-09-05 12:35:00 +0000 |
commit | 7d95ff76e6d42855a3fa4431116dded5b0549ecb (patch) | |
tree | dab49985d5fb0c1cc51f0fd18de9db0297c4c647 /crypto/bio | |
parent | affadbef0b88dac4c33d5ecdc0f431f2a3ffbec5 (diff) | |
download | openssl-7d95ff76e6d42855a3fa4431116dded5b0549ecb.tar.gz |
Remove silly test for b->references at the end of BIO_write:
If some other thread deletes the BIO that one thread needs for
BIO_write, then there's a lot of trouble anyway; there's
nothing special about calling the callback.
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio_lib.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index 3b9f415fb2..ffdec3725d 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -201,15 +201,7 @@ int BIO_write(BIO *b, const void *in, int inl) if (i > 0) b->num_write+=(unsigned long)i; - /* This is evil and not thread safe. If the BIO has been freed, - * we must not call the callback. The only way to be able to - * determine this is the reference count which is now invalid since - * the memory has been free()ed. - */ -#ifdef REF_CHECK - if (b->references <= 0) abort(); -#endif - if (cb != NULL) /* && (b->references >= 1)) */ + if (cb != NULL) i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl, 0L,(long)i); return(i); @@ -240,6 +232,8 @@ int BIO_puts(BIO *b, const char *in) i=b->method->bputs(b,in); + if (i > 0) b->num_write+=(unsigned long)i; + if (cb != NULL) i=(int)cb(b,BIO_CB_PUTS|BIO_CB_RETURN,in,0, 0L,(long)i); |