Lines Matching refs:peer_b
115 struct bio_bio_st *b, *peer_b; in bio_read() local
125 peer_b = b->peer->ptr; in bio_read()
126 assert(peer_b != NULL); in bio_read()
127 assert(peer_b->buf != NULL); in bio_read()
129 peer_b->request = 0; /* will be set in "retry_read" situation */ in bio_read()
134 if (peer_b->len == 0) { in bio_read()
135 if (peer_b->closed) in bio_read()
139 if (size <= peer_b->size) in bio_read()
140 peer_b->request = size; in bio_read()
145 peer_b->request = peer_b->size; in bio_read()
151 if (peer_b->len < size) in bio_read()
152 size = peer_b->len; in bio_read()
162 assert(rest <= peer_b->len); in bio_read()
163 if (peer_b->offset + rest <= peer_b->size) in bio_read()
167 chunk = peer_b->size - peer_b->offset; in bio_read()
168 assert(peer_b->offset + chunk <= peer_b->size); in bio_read()
170 memcpy(buf, peer_b->buf + peer_b->offset, chunk); in bio_read()
172 peer_b->len -= chunk; in bio_read()
173 if (peer_b->len) { in bio_read()
174 peer_b->offset += chunk; in bio_read()
175 assert(peer_b->offset <= peer_b->size); in bio_read()
176 if (peer_b->offset == peer_b->size) in bio_read()
177 peer_b->offset = 0; in bio_read()
182 peer_b->offset = 0; in bio_read()
204 struct bio_bio_st *b, *peer_b; in bio_nread0() local
215 peer_b = b->peer->ptr; in bio_nread0()
216 assert(peer_b != NULL); in bio_nread0()
217 assert(peer_b->buf != NULL); in bio_nread0()
219 peer_b->request = 0; in bio_nread0()
221 if (peer_b->len == 0) { in bio_nread0()
228 num = peer_b->len; in bio_nread0()
229 if (peer_b->size < peer_b->offset + num) in bio_nread0()
231 num = peer_b->size - peer_b->offset; in bio_nread0()
235 *buf = peer_b->buf + peer_b->offset; in bio_nread0()
241 struct bio_bio_st *b, *peer_b; in bio_nread() local
256 peer_b = b->peer->ptr; in bio_nread()
258 peer_b->len -= num; in bio_nread()
259 if (peer_b->len) { in bio_nread()
260 peer_b->offset += num; in bio_nread()
261 assert(peer_b->offset <= peer_b->size); in bio_nread()
262 if (peer_b->offset == peer_b->size) in bio_nread()
263 peer_b->offset = 0; in bio_nread()
265 peer_b->offset = 0; in bio_nread()
548 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl() local
550 ret = (long)peer_b->len; in bio_ctrl()
586 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl() local
588 if (peer_b->len == 0 && peer_b->closed) in bio_ctrl()
664 struct bio_bio_st *peer_b = peer_bio->ptr; in bio_destroy_pair() local
666 assert(peer_b != NULL); in bio_destroy_pair()
667 assert(peer_b->peer == bio); in bio_destroy_pair()
669 peer_b->peer = NULL; in bio_destroy_pair()
671 assert(peer_b->buf != NULL); in bio_destroy_pair()
672 peer_b->len = 0; in bio_destroy_pair()
673 peer_b->offset = 0; in bio_destroy_pair()