소스 검색

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 8 년 전
committed by CQ bot account: commit-bot@chromium.org
부모
커밋
32d961ae48
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. +4
    -0
      crypto/bio/bio.c
  2. +5
    -0
      include/openssl/bio.h

+ 4
- 0
crypto/bio/bio.c 파일 보기

@@ -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 파일 보기

@@ -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);



불러오는 중...
취소
저장