-/* $OpenBSD: bio_lib.c,v 1.38 2022/11/30 01:56:18 jsing Exp $ */
+/* $OpenBSD: bio_lib.c,v 1.39 2022/12/02 19:44:04 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
bio->retry_reason = 0;
bio->num = 0;
bio->ptr = NULL;
+ bio->prev_bio = NULL;
bio->next_bio = NULL;
bio->references = 1;
bio->num_read = 0L;
while (lb->next_bio != NULL)
lb = lb->next_bio;
lb->next_bio = bio;
+ if (bio != NULL)
+ bio->prev_bio = lb;
/* called to do internal processing */
BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);
return (b);
BIO_ctrl(b, BIO_CTRL_POP, 0, b);
+ if (b->prev_bio != NULL)
+ b->prev_bio->next_bio = b->next_bio;
+ if (b->next_bio != NULL)
+ b->next_bio->prev_bio = b->prev_bio;
+
b->next_bio = NULL;
+ b->prev_bio = NULL;
return (ret);
}
-/* $OpenBSD: bio_local.h,v 1.4 2022/11/28 07:50:00 tb Exp $ */
+/* $OpenBSD: bio_local.h,v 1.5 2022/12/02 19:44:04 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int num;
void *ptr;
struct bio_st *next_bio; /* used by filter BIOs */
+ struct bio_st *prev_bio; /* used by filter BIOs */
int references;
unsigned long num_read;
unsigned long num_write;