Ver a proveniência

Implement BIO_eof() for compatibility

This function (actually a macro in OpenSSL) is used by several projects
(e.g. OpenResty, OpenVPN, ...) so it can useuful to provide it for
compatibility.

However, depending on the semantics of the BIO type (e.g. BIO_pair), the
return value can be meaningless, which might explain why it was removed.

Change-Id: I0e432c92222c267eb994d32b0bc28e999c4b40a7
Reviewed-on: https://boringssl-review.googlesource.com/11020
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Alessandro Ghedini há 8 anos
committed by CQ bot account: commit-bot@chromium.org
ascendente
cometimento
32d961ae48
2 ficheiros alterados com 9 adições e 0 eliminações
  1. +4
    -0
      crypto/bio/bio.c
  2. +5
    -0
      include/openssl/bio.h

+ 4
- 0
crypto/bio/bio.c Ver ficheiro

@@ -243,6 +243,10 @@ int BIO_reset(BIO *bio) {
return BIO_ctrl(bio, BIO_CTRL_RESET, 0, NULL);
}

int BIO_eof(BIO *bio) {
return BIO_ctrl(bio, BIO_CTRL_EOF, 0, NULL);
}

void BIO_set_flags(BIO *bio, int flags) {
bio->flags |= flags;
}


+ 5
- 0
include/openssl/bio.h Ver ficheiro

@@ -152,6 +152,11 @@ OPENSSL_EXPORT long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
* otherwise. */
OPENSSL_EXPORT int BIO_reset(BIO *bio);

/* BIO_eof returns non-zero when |bio| has reached end-of-file. The precise
* meaning of which depends on the concrete type of |bio|. Note that in the
* case of BIO_pair this always returns non-zero. */
OPENSSL_EXPORT int BIO_eof(BIO *bio);

/* BIO_set_flags ORs |flags| with |bio->flags|. */
OPENSSL_EXPORT void BIO_set_flags(BIO *bio, int flags);



Carregando…
Cancelar
Guardar