adjust to new vsb api

parent 39b5145b
......@@ -68,7 +68,7 @@ tus_chksum_init(VRT_CTX) {
char buf[512];
int first = 1;
AN(VSB_new(names, buf, sizeof buf, VSB_FIXEDLEN));
AN(VSB_init(names, buf, sizeof buf));
load_vmod(&import_Vmod_blob_Data, &dl_vmod_blob,
(const void **)&vmod_blob);
......@@ -96,6 +96,7 @@ tus_chksum_init(VRT_CTX) {
#include "tbl_hash_enum.h"
AZ(VSB_finish(names));
REPLACE(hashes, VSB_data(names));
VSB_fini(names);
fprintf(stderr, "digests OK\n");
// dummy ref to appease compiler
......
......@@ -752,7 +752,7 @@ tus_file_new(VRT_CTX, struct VPFX(tus_server) *srv, enum tus_f_type type,
}
/* there is no mkostempat() */
AN(VSB_new(vsb_path, buf, sizeof buf, VSB_FIXEDLEN));
AN(VSB_init(vsb_path, buf, sizeof buf));
VSB_cat(vsb_path, tus_server_basedir(srv));
VSB_cat(vsb_path, "/" TUS_FILE_PFX);
tus_name_rnd(vsb_path);
......@@ -767,6 +767,7 @@ tus_file_new(VRT_CTX, struct VPFX(tus_server) *srv, enum tus_f_type type,
return (NULL);
}
path = VSB_data(vsb_path);
VSB_fini(vsb_path);
if (fallocate(fd, 0, 0, header_size)) {
VSLb(ctx->vsl, SLT_Error, "%s: fallocate(%s) failed: %d (%s)",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment