Lines Matching refs:toSend
131 …t cq, off_t * const p_max_bytes, log_error_st * const errh, const ssize_t wr, const off_t toSend) { in network_write_accounting() argument
134 const int rc = (wr == toSend && *p_max_bytes > 0) ? 0 : -3; in network_write_accounting()
166 off_t toSend = c->file.length - c->offset; in network_write_file_chunk_no_mmap() local
169 if (toSend > *p_max_bytes) toSend = *p_max_bytes; in network_write_file_chunk_no_mmap()
170 if (toSend <= 0) return network_remove_finished_chunks(cq, toSend); in network_write_file_chunk_no_mmap()
171 if (toSend > (off_t)sizeof(buf)) toSend = (off_t)sizeof(buf); in network_write_file_chunk_no_mmap()
175 toSend = chunk_file_pread(c->file.fd, buf, toSend, c->offset); in network_write_file_chunk_no_mmap()
176 if (toSend <= 0) { in network_write_file_chunk_no_mmap()
181 ssize_t wr = network_write_data_len(fd, buf, toSend); in network_write_file_chunk_no_mmap()
182 return network_write_accounting(fd, cq, p_max_bytes, errh, wr, toSend); in network_write_file_chunk_no_mmap()
207 off_t toSend = c->file.length - c->offset; in network_write_file_chunk_mmap() local
208 if (toSend > *p_max_bytes) toSend = *p_max_bytes; in network_write_file_chunk_mmap()
209 if (toSend <= 0) return network_remove_finished_chunks(cq, toSend); in network_write_file_chunk_mmap()
213 if (toSend > mmap_avail) toSend = mmap_avail; in network_write_file_chunk_mmap()
215 (void *)(uintptr_t)fd, data, toSend); in network_write_file_chunk_mmap()
216 return network_write_accounting(fd,cq,p_max_bytes,errh,(ssize_t)wr,toSend); in network_write_file_chunk_mmap()
256 off_t toSend = 0; in network_writev_mem_chunks() local
262 toSend += c_len; in network_writev_mem_chunks()
267 if (++num_chunks == MAX_CHUNKS || toSend >= *p_max_bytes) break; in network_writev_mem_chunks()
275 return network_write_accounting(fd, cq, p_max_bytes, errh, wr, toSend); in network_writev_mem_chunks()
299 off_t toSend; in network_write_file_chunk_sendfile() local
303 toSend = c->file.length - c->offset; in network_write_file_chunk_sendfile()
304 if (toSend > *p_max_bytes) toSend = *p_max_bytes; in network_write_file_chunk_sendfile()
305 if (toSend <= 0) return network_remove_finished_chunks(cq, toSend); in network_write_file_chunk_sendfile()
314 wr = sendfile(fd, c->file.fd, &offset, toSend); in network_write_file_chunk_sendfile()
319 written = toSend; in network_write_file_chunk_sendfile()
325 wr = sendfile(c->file.fd, fd, offset, toSend, NULL, &written, 0); in network_write_file_chunk_sendfile()
334 fvec.sfv_len = toSend; in network_write_file_chunk_sendfile()
392 return (wr >= 0 && written == toSend) ? 0 : -3; in network_write_file_chunk_sendfile()