Browse Source

[core] off_t upload_temp_file_size

personal/stbuehler/ci-build
Glenn Strauss 3 years ago
parent
commit
f2ac4cdfc5
  1. 8
      src/chunk.c
  2. 5
      src/chunk.h

8
src/chunk.c

@ -29,7 +29,7 @@ static size_t chunk_buf_sz = 4096;
static chunk *chunks;
static chunk *chunk_buffers;
static array *chunkqueue_default_tempdirs = NULL;
static unsigned int chunkqueue_default_tempfile_size = DEFAULT_TEMPFILE_SIZE;
static off_t chunkqueue_default_tempfile_size = DEFAULT_TEMPFILE_SIZE;
void chunkqueue_set_chunk_size (size_t sz)
{
@ -444,7 +444,7 @@ void chunkqueue_use_memory(chunkqueue *cq, size_t len) {
}
}
void chunkqueue_set_tempdirs_default (array *tempdirs, unsigned int upload_temp_file_size) {
void chunkqueue_set_tempdirs_default (array *tempdirs, off_t upload_temp_file_size) {
chunkqueue_default_tempdirs = tempdirs;
chunkqueue_default_tempfile_size
= (0 == upload_temp_file_size) ? DEFAULT_TEMPFILE_SIZE
@ -452,8 +452,7 @@ void chunkqueue_set_tempdirs_default (array *tempdirs, unsigned int upload_temp_
: upload_temp_file_size;
}
#if 0
void chunkqueue_set_tempdirs(chunkqueue *cq, array *tempdirs, unsigned int upload_temp_file_size) {
void chunkqueue_set_tempdirs(chunkqueue *cq, array *tempdirs, off_t upload_temp_file_size) {
force_assert(NULL != cq);
cq->tempdirs = tempdirs;
cq->upload_temp_file_size
@ -462,7 +461,6 @@ void chunkqueue_set_tempdirs(chunkqueue *cq, array *tempdirs, unsigned int uploa
: upload_temp_file_size;
cq->tempdir_idx = 0;
}
#endif
void chunkqueue_steal(chunkqueue *dest, chunkqueue *src, off_t len) {
while (len > 0) {

5
src/chunk.h

@ -43,7 +43,7 @@ typedef struct {
off_t bytes_in, bytes_out;
array *tempdirs;
unsigned int upload_temp_file_size;
off_t upload_temp_file_size;
unsigned int tempdir_idx;
} chunkqueue;
@ -56,7 +56,8 @@ void chunkqueue_chunk_pool_free(void);
chunkqueue *chunkqueue_init(void);
void chunkqueue_set_chunk_size (size_t sz);
void chunkqueue_set_tempdirs_default_reset (void);
void chunkqueue_set_tempdirs_default (array *tempdirs, unsigned int upload_temp_file_size);
void chunkqueue_set_tempdirs_default (array *tempdirs, off_t upload_temp_file_size);
void chunkqueue_set_tempdirs(chunkqueue *cq, array *tempdirs, off_t upload_temp_file_size);
void chunkqueue_append_file(chunkqueue *cq, buffer *fn, off_t offset, off_t len); /* copies "fn" */
void chunkqueue_append_file_fd(chunkqueue *cq, buffer *fn, int fd, off_t offset, off_t len); /* copies "fn" */
void chunkqueue_append_mem(chunkqueue *cq, const char *mem, size_t len); /* copies memory */

Loading…
Cancel
Save