Browse Source

[mod_ssi] update chunk after shell output redirect

chunkqueue_update_file() to update size of file chunk after
redirecting shell output to file fd
master
Glenn Strauss 1 year ago
parent
commit
9f8a896891
  1. 6
      src/chunk.c
  2. 1
      src/chunk.h
  3. 2
      src/mod_ssi.c

6
src/chunk.c

@ -446,6 +446,12 @@ void chunkqueue_use_memory(chunkqueue * const restrict cq, chunk *ckpt, size_t l
*(ckpt ? &ckpt->next : &cq->first) = NULL;
}
void chunkqueue_update_file(chunkqueue * const restrict cq, chunk *c, off_t len) {
/*assert(c->type == FILE_CHUNK);*/
c->file.length += len;
cq->bytes_in += len;
}
void chunkqueue_set_tempdirs_default (const array *tempdirs, off_t upload_temp_file_size) {
chunkqueue_default_tempdirs = tempdirs;
chunkqueue_default_tempfile_size

1
src/chunk.h

@ -105,6 +105,7 @@ __attribute_returns_nonnull__
char * chunkqueue_get_memory(chunkqueue * restrict cq, size_t * restrict len);
/* commit len bytes of mem obtained from chunkqueue_get_memory() */
void chunkqueue_use_memory(chunkqueue * restrict cq, chunk *ckpt, size_t len);
void chunkqueue_update_file(chunkqueue * restrict cq, chunk *c, off_t len);
/* mark first "len" bytes as written (incrementing chunk offsets)
* and remove finished chunks

2
src/mod_ssi.c

@ -816,7 +816,7 @@ static int process_ssi_stmt(request_st * const r, handler_ctx * const p, const c
log_error(errh, __FILE__, __LINE__, "process exited abnormally: %s", cmd);
}
if (0 == fstat(c->file.fd, &stb)) {
c->file.length = stb.st_size;
chunkqueue_update_file(cq, c, stb.st_size);
}
}

Loading…
Cancel
Save