Lines Matching refs:peer_b

113     struct bio_bio_st *b, *peer_b;  in bio_read()  local
123 peer_b = b->peer->ptr; in bio_read()
124 assert(peer_b != NULL); in bio_read()
125 assert(peer_b->buf != NULL); in bio_read()
127 peer_b->request = 0; /* will be set in "retry_read" situation */ in bio_read()
132 if (peer_b->len == 0) { in bio_read()
133 if (peer_b->closed) in bio_read()
137 if (size <= peer_b->size) in bio_read()
138 peer_b->request = size; in bio_read()
143 peer_b->request = peer_b->size; in bio_read()
149 if (peer_b->len < size) in bio_read()
150 size = peer_b->len; in bio_read()
160 assert(rest <= peer_b->len); in bio_read()
161 if (peer_b->offset + rest <= peer_b->size) in bio_read()
165 chunk = peer_b->size - peer_b->offset; in bio_read()
166 assert(peer_b->offset + chunk <= peer_b->size); in bio_read()
168 memcpy(buf, peer_b->buf + peer_b->offset, chunk); in bio_read()
170 peer_b->len -= chunk; in bio_read()
171 if (peer_b->len) { in bio_read()
172 peer_b->offset += chunk; in bio_read()
173 assert(peer_b->offset <= peer_b->size); in bio_read()
174 if (peer_b->offset == peer_b->size) in bio_read()
175 peer_b->offset = 0; in bio_read()
180 peer_b->offset = 0; in bio_read()
202 struct bio_bio_st *b, *peer_b; in bio_nread0() local
213 peer_b = b->peer->ptr; in bio_nread0()
214 assert(peer_b != NULL); in bio_nread0()
215 assert(peer_b->buf != NULL); in bio_nread0()
217 peer_b->request = 0; in bio_nread0()
219 if (peer_b->len == 0) { in bio_nread0()
226 num = peer_b->len; in bio_nread0()
227 if (peer_b->size < peer_b->offset + num) in bio_nread0()
229 num = peer_b->size - peer_b->offset; in bio_nread0()
233 *buf = peer_b->buf + peer_b->offset; in bio_nread0()
239 struct bio_bio_st *b, *peer_b; in bio_nread() local
254 peer_b = b->peer->ptr; in bio_nread()
256 peer_b->len -= num; in bio_nread()
257 if (peer_b->len) { in bio_nread()
258 peer_b->offset += num; in bio_nread()
259 assert(peer_b->offset <= peer_b->size); in bio_nread()
260 if (peer_b->offset == peer_b->size) in bio_nread()
261 peer_b->offset = 0; in bio_nread()
263 peer_b->offset = 0; in bio_nread()
546 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl() local
548 ret = (long)peer_b->len; in bio_ctrl()
584 struct bio_bio_st *peer_b = b->peer->ptr; in bio_ctrl() local
586 if (peer_b->len == 0 && peer_b->closed) in bio_ctrl()
658 struct bio_bio_st *peer_b = peer_bio->ptr; in bio_destroy_pair() local
660 assert(peer_b != NULL); in bio_destroy_pair()
661 assert(peer_b->peer == bio); in bio_destroy_pair()
663 peer_b->peer = NULL; in bio_destroy_pair()
665 assert(peer_b->buf != NULL); in bio_destroy_pair()
666 peer_b->len = 0; in bio_destroy_pair()
667 peer_b->offset = 0; in bio_destroy_pair()