static int compare_with_file(BIO *membio)
{
- BIO *file = NULL;
+ BIO *file = NULL, *newfile = NULL;
char buf1[512], buf2[512];
char *reffile;
int ret = 0;
if (!TEST_ptr(file))
goto err;
+ newfile = BIO_new_file("ssltraceref-new.txt", "wb");
+ if (!TEST_ptr(newfile))
+ goto err;
+
+ while (BIO_gets(membio, buf2, sizeof(buf2)) > 0)
+ if (BIO_puts(newfile, buf2) <= 0) {
+ TEST_error("Failed writing new file data");
+ goto err;
+ }
+
+ if (!TEST_int_ge(BIO_seek(membio, 0), 0))
+ goto err;
+
while (BIO_gets(file, buf1, sizeof(buf1)) > 0) {
if (BIO_gets(membio, buf2, sizeof(buf2)) <= 0) {
TEST_error("Failed reading mem data");
err:
OPENSSL_free(reffile);
BIO_free(file);
+ BIO_free(newfile);
return ret;
}
------------------
No extensions
+Sent Frame: Ack (without ECN)
+ Largest acked: 0
+ Ack delay (raw) 0
+ Ack range count: 0
+ First ack range: 0
+Sent Frame: Padding
+Sent Packet
+ Packet Type: Initial
+ Version: 0x00000001
+ Destination Conn Id: 0x????????????????
+ Source Conn Id: <zero length id>
+ Payload length: 1178
+ Token: <zerlo length token>
+ Packet Number: 0x00000001
+Sent Datagram
+ Length: 1200
Received Datagram
Length: 234
Received Packet