Skip to content

Commit 11f9c5e

Browse files
Return raw retval on error
1 parent 886ed24 commit 11f9c5e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ssl/ssl_lib.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,12 +1044,12 @@ int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *read_bytes) {
10441044
return 1;
10451045
}
10461046
int ret = SSL_read(ssl, buf, (int)num);
1047+
if (ret <= 0) {
1048+
return ret;
1049+
}
10471050
if (read_bytes != nullptr) {
10481051
*read_bytes = ret;
10491052
}
1050-
if (ret <= 0) {
1051-
return 0;
1052-
}
10531053
return 1;
10541054
}
10551055

@@ -1143,12 +1143,12 @@ int SSL_write_ex(SSL *ssl, const void *buf, size_t num, size_t *written) {
11431143
return 1;
11441144
}
11451145
int ret = SSL_write(ssl, buf, (int)num);
1146+
if (ret <= 0) {
1147+
return ret;
1148+
}
11461149
if (written != nullptr) {
11471150
*written = ret;
11481151
}
1149-
if (ret <= 0) {
1150-
return 0;
1151-
}
11521152
return 1;
11531153
}
11541154

0 commit comments

Comments
 (0)