@@ -115,19 +115,17 @@ static long callback_fn_wrap_ex(BIO *bio, int oper, const char *argp,
115
115
return ret ;
116
116
}
117
117
118
- // |get_callback| returns the appropriate callback function for a given |BIO|, preferring
119
- // the extended interface |callback_ex| over the legacy interface.
118
+ // |get_callback| returns the appropriate callback function for a given |BIO|, preferring
119
+ // the extended interface |callback_ex| over the legacy interface.
120
120
//
121
- // When only the legacy callback is available, it is wrapped in the extended format
122
- // via |callback_fn_wrap_ex| to provide a consistent interface. The extended callback
123
- // provides additional parameters for length and bytes processed tracking.
121
+ // When only the legacy callback is available, it is wrapped in the extended format
122
+ // via |callback_fn_wrap_ex| to provide a consistent interface. The extended callback
123
+ // provides additional parameters for length and bytes processed tracking.
124
124
//
125
- // Returns the |callback_ex| function if available, a wrapped legacy callback if only
126
- // |callback| is set, or NULL if no callbacks are set.
125
+ // Returns the |callback_ex| function if available, a wrapped legacy callback if only
126
+ // |callback| is set, or NULL if no callbacks are set.
127
127
static BIO_callback_fn_ex get_callback (BIO * bio ) {
128
- if (bio == NULL ) {
129
- return NULL ;
130
- }
128
+ assert (bio != NULL );
131
129
132
130
if (bio -> callback_ex != NULL ) {
133
131
return bio -> callback_ex ;
@@ -251,7 +249,6 @@ void BIO_free_all(BIO *bio) {
251
249
}
252
250
253
251
int BIO_read (BIO * bio , void * buf , int len ) {
254
- int ret = 0 ;
255
252
256
253
if (bio == NULL || bio -> method == NULL || bio -> method -> bread == NULL ) {
257
254
OPENSSL_PUT_ERROR (BIO , BIO_R_UNSUPPORTED_METHOD );
@@ -276,7 +273,7 @@ int BIO_read(BIO *bio, void *buf, int len) {
276
273
OPENSSL_PUT_ERROR (BIO , BIO_R_UNINITIALIZED );
277
274
return -2 ;
278
275
}
279
- ret = bio -> method -> bread (bio , buf , len );
276
+ int ret = bio -> method -> bread (bio , buf , len );
280
277
281
278
return handle_callback_return (bio , BIO_CB_READ , buf , len , ret );
282
279
}
@@ -332,7 +329,7 @@ int BIO_gets(BIO *bio, char *buf, int len) {
332
329
}
333
330
334
331
int BIO_write (BIO * bio , const void * in , int inl ) {
335
- int ret = 0 ;
332
+
336
333
if (bio == NULL || bio -> method == NULL || bio -> method -> bwrite == NULL ) {
337
334
OPENSSL_PUT_ERROR (BIO , BIO_R_UNSUPPORTED_METHOD );
338
335
return -2 ;
@@ -356,7 +353,7 @@ int BIO_write(BIO *bio, const void *in, int inl) {
356
353
OPENSSL_PUT_ERROR (BIO , BIO_R_UNINITIALIZED );
357
354
return -2 ;
358
355
}
359
- ret = bio -> method -> bwrite (bio , in , inl );
356
+ int ret = bio -> method -> bwrite (bio , in , inl );
360
357
361
358
return handle_callback_return (bio , BIO_CB_WRITE , in , inl , ret );
362
359
}
0 commit comments