use BIO_nwrite() more properly
This commit is contained in:
parent
2fc1f3dd48
commit
13962f0b15
@ -1053,9 +1053,9 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count,
|
|||||||
if (num > 1)
|
if (num > 1)
|
||||||
--num; /* test restartability even more thoroughly */
|
--num; /* test restartability even more thoroughly */
|
||||||
|
|
||||||
r = BIO_nwrite(io1, &dataptr, (int)num);
|
r = BIO_nwrite0(io1, &dataptr);
|
||||||
assert(r > 0);
|
assert(r > 0);
|
||||||
assert(r <= (int)num);
|
if (r < num)
|
||||||
num = r;
|
num = r;
|
||||||
r = BIO_read(io2, dataptr, (int)num);
|
r = BIO_read(io2, dataptr, (int)num);
|
||||||
if (r != (int)num) /* can't happen */
|
if (r != (int)num) /* can't happen */
|
||||||
@ -1065,6 +1065,13 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
progress = 1;
|
progress = 1;
|
||||||
|
r = BIO_nwrite(io1, &dataptr, (int)num);
|
||||||
|
if (r != (int)num) /* can't happen */
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ERROR: BIO_nwrite() did not accept "
|
||||||
|
"BIO_nwrite0() bytes");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
printf((io2 == client_io) ?
|
printf((io2 == client_io) ?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user