Browse Source

[core] expose chunkqueue_remove_empty_chunks()

expose chunkqueue_remove_empty_chunks() for use in error recovery
when aborting a chunkqueue_append_buffer_open*()
Glenn Strauss 1 month ago
parent
commit
75dd8f2bc0
  1. 5
      src/chunk.c
  2. 1
      src/chunk.h
  3. 2
      src/h2.c

5
src/chunk.c

@ -506,9 +506,6 @@ void chunkqueue_append_buffer_commit(chunkqueue *cq) {
}
static void chunkqueue_remove_empty_chunks(chunkqueue *cq);
char * chunkqueue_get_memory(chunkqueue * const restrict cq, size_t * const restrict len) {
size_t sz = *len ? *len : (chunk_buf_sz >> 1);
buffer *b;
@ -1082,7 +1079,7 @@ void chunkqueue_remove_finished_chunks(chunkqueue *cq) {
}
}
static void chunkqueue_remove_empty_chunks(chunkqueue *cq) {
void chunkqueue_remove_empty_chunks(chunkqueue *cq) {
chunk *c;
chunkqueue_remove_finished_chunks(cq);

1
src/chunk.h

@ -140,6 +140,7 @@ void chunkqueue_update_file(chunkqueue * restrict cq, chunk *c, off_t len);
void chunkqueue_mark_written(chunkqueue *cq, off_t len);
void chunkqueue_remove_finished_chunks(chunkqueue *cq);
void chunkqueue_remove_empty_chunks(chunkqueue *cq);
void chunkqueue_steal(chunkqueue * restrict dest, chunkqueue * restrict src, off_t len);
int chunkqueue_steal_with_tempfiles(chunkqueue * restrict dest, chunkqueue * restrict src, off_t len, struct log_error_st * const restrict errh);

2
src/h2.c

@ -2464,7 +2464,7 @@ h2_send_cqdata (request_st * const r, connection * const con, chunkqueue * const
}
/*(else remove empty last chunk and fall through to below)*/
chunkqueue_remove_finished_chunks(cq);
chunkqueue_remove_empty_chunks(cq);
}
const uint32_t len = dlen < fsize ? dlen : fsize;

Loading…
Cancel
Save