Lines Matching refs:b

78     struct bio_bio_st *b = OPENSSL_zalloc(sizeof(*b));  in bio_new()  local
80 if (b == NULL) in bio_new()
84 b->size = 17 * 1024; in bio_new()
86 bio->ptr = b; in bio_new()
92 struct bio_bio_st *b; in bio_free() local
96 b = bio->ptr; in bio_free()
98 assert(b != NULL); in bio_free()
100 if (b->peer) in bio_free()
103 OPENSSL_free(b->buf); in bio_free()
104 OPENSSL_free(b); in bio_free()
113 struct bio_bio_st *b, *peer_b; in bio_read() local
120 b = bio->ptr; in bio_read()
121 assert(b != NULL); in bio_read()
122 assert(b->peer != NULL); in bio_read()
123 peer_b = b->peer->ptr; in bio_read()
202 struct bio_bio_st *b, *peer_b; in bio_nread0() local
210 b = bio->ptr; in bio_nread0()
211 assert(b != NULL); in bio_nread0()
212 assert(b->peer != NULL); in bio_nread0()
213 peer_b = b->peer->ptr; in bio_nread0()
239 struct bio_bio_st *b, *peer_b; in bio_nread() local
253 b = bio->ptr; in bio_nread()
254 peer_b = b->peer->ptr; in bio_nread()
272 struct bio_bio_st *b; in bio_write() local
279 b = bio->ptr; in bio_write()
280 assert(b != NULL); in bio_write()
281 assert(b->peer != NULL); in bio_write()
282 assert(b->buf != NULL); in bio_write()
284 b->request = 0; in bio_write()
285 if (b->closed) { in bio_write()
291 assert(b->len <= b->size); in bio_write()
293 if (b->len == b->size) { in bio_write()
299 if (num > b->size - b->len) in bio_write()
300 num = b->size - b->len; in bio_write()
311 assert(b->len + rest <= b->size); in bio_write()
313 write_offset = b->offset + b->len; in bio_write()
314 if (write_offset >= b->size) in bio_write()
315 write_offset -= b->size; in bio_write()
318 if (write_offset + rest <= b->size) in bio_write()
322 chunk = b->size - write_offset; in bio_write()
324 memcpy(b->buf + write_offset, buf, chunk); in bio_write()
326 b->len += chunk; in bio_write()
328 assert(b->len <= b->size); in bio_write()
347 struct bio_bio_st *b; in bio_nwrite0() local
356 b = bio->ptr; in bio_nwrite0()
357 assert(b != NULL); in bio_nwrite0()
358 assert(b->peer != NULL); in bio_nwrite0()
359 assert(b->buf != NULL); in bio_nwrite0()
361 b->request = 0; in bio_nwrite0()
362 if (b->closed) { in bio_nwrite0()
367 assert(b->len <= b->size); in bio_nwrite0()
369 if (b->len == b->size) { in bio_nwrite0()
374 num = b->size - b->len; in bio_nwrite0()
375 write_offset = b->offset + b->len; in bio_nwrite0()
376 if (write_offset >= b->size) in bio_nwrite0()
377 write_offset -= b->size; in bio_nwrite0()
378 if (write_offset + num > b->size) in bio_nwrite0()
384 num = b->size - write_offset; in bio_nwrite0()
387 *buf = b->buf + write_offset; in bio_nwrite0()
388 assert(write_offset + num <= b->size); in bio_nwrite0()
395 struct bio_bio_st *b; in bio_nwrite() local
408 b = bio->ptr; in bio_nwrite()
409 assert(b != NULL); in bio_nwrite()
410 b->len += num; in bio_nwrite()
411 assert(b->len <= b->size); in bio_nwrite()
419 struct bio_bio_st *b = bio->ptr; in bio_ctrl() local
421 assert(b != NULL); in bio_ctrl()
427 if (b->peer) { in bio_ctrl()
436 if (b->size != new_size) { in bio_ctrl()
437 OPENSSL_free(b->buf); in bio_ctrl()
438 b->buf = NULL; in bio_ctrl()
439 b->size = new_size; in bio_ctrl()
446 ret = (long)b->size; in bio_ctrl()
474 if (b->peer == NULL || b->closed) in bio_ctrl()
477 ret = (long)b->size - b->len; in bio_ctrl()
486 ret = (long)b->request; in bio_ctrl()
495 b->request = 0; in bio_ctrl()
501 b->closed = 1; in bio_ctrl()
528 if (b->buf != NULL) { in bio_ctrl()
529 b->len = 0; in bio_ctrl()
530 b->offset = 0; in bio_ctrl()
545 if (b->peer != NULL) { in bio_ctrl()
546 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl()
554 if (b->buf != NULL) in bio_ctrl()
555 ret = (long)b->len; in bio_ctrl()
572 other_b->size = b->size; in bio_ctrl()
583 if (b->peer != NULL) { in bio_ctrl()
584 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl()
652 struct bio_bio_st *b = bio->ptr; in bio_destroy_pair() local
654 if (b != NULL) { in bio_destroy_pair()
655 BIO *peer_bio = b->peer; in bio_destroy_pair()
669 b->peer = NULL; in bio_destroy_pair()
671 assert(b->buf != NULL); in bio_destroy_pair()
672 b->len = 0; in bio_destroy_pair()
673 b->offset = 0; in bio_destroy_pair()