diff options
author | Richard Levitte <levitte@openssl.org> | 2000-09-20 13:55:50 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-09-20 13:55:50 +0000 |
commit | 645749ef98612340b11c4bf2ba856e1fa469912b (patch) | |
tree | 3a93d71b7f63b5b01f085c38211ce82af0778125 /apps/openssl.c | |
parent | 9a0c0d3f7441515452caff3380b235bb15d33a5e (diff) | |
download | openssl-645749ef98612340b11c4bf2ba856e1fa469912b.tar.gz |
On VMS, stdout may very well lead to a file that is written to in a
record-oriented fashion. That means that every write() will write a
separate record, which will be read separately by the programs trying
to read from it. This can be very confusing.
The solution is to put a BIO filter in the way that will buffer text
until a linefeed is reached, and then write everything a line at a
time, so every record written will be an actual line, not chunks of
lines and not (usually doesn't happen, but I've seen it once) several
lines in one record. Voila, BIO_f_linebuffer() is born.
Since we're so close to release time, I'm making this VMS-only for
now, just to make sure no code is needlessly broken by this. After
the release, this BIO method will be enabled on all other platforms as
well.
Diffstat (limited to 'apps/openssl.c')
-rw-r--r-- | apps/openssl.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index c3680c5e71..4f61006b73 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -238,13 +238,19 @@ static int do_cmd(LHASH *prog, int argc, char *argv[]) else if ((strncmp(argv[0],"no-",3)) == 0) { BIO *bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE); +#ifdef VMS + { + BIO *tmpbio = BIO_new(BIO_f_linebuffer()); + bio_stdout = BIO_push(tmpbio, bio_stdout); + } +#endif f.name=argv[0]+3; ret = (lh_retrieve(prog,&f) != NULL); if (!ret) BIO_printf(bio_stdout, "%s\n", argv[0]); else BIO_printf(bio_stdout, "%s\n", argv[0]+3); - BIO_free(bio_stdout); + BIO_free_all(bio_stdout); goto end; } else if ((strcmp(argv[0],"quit") == 0) || @@ -269,11 +275,17 @@ static int do_cmd(LHASH *prog, int argc, char *argv[]) else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */ list_type = FUNC_TYPE_CIPHER; bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE); +#ifdef VMS + { + BIO *tmpbio = BIO_new(BIO_f_linebuffer()); + bio_stdout = BIO_push(tmpbio, bio_stdout); + } +#endif for (fp=functions; fp->name != NULL; fp++) if (fp->type == list_type) BIO_printf(bio_stdout, "%s\n", fp->name); - BIO_free(bio_stdout); + BIO_free_all(bio_stdout); ret=0; goto end; } |