fail more gracefully for vmods missing

parent 1187d4bd
...@@ -34,6 +34,7 @@ libvmod_tus_la_SOURCES = \ ...@@ -34,6 +34,7 @@ libvmod_tus_la_SOURCES = \
tus_b64.h \ tus_b64.h \
tus_blob.c \ tus_blob.c \
tus_blob.h \ tus_blob.h \
tus_checksums.h \
tus_concat.h \ tus_concat.h \
tus_file.c \ tus_file.c \
tus_file.h \ tus_file.h \
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "vmod_blobdigest.h" #include "vmod_blobdigest.h"
#include "tus_b64.h" #include "tus_b64.h"
#include "tus_blob.h" #include "tus_blob.h"
#include "tus_checksums.h"
static const struct Vmod_vmod_blob_Func *vmod_blob = NULL; static const struct Vmod_vmod_blob_Func *vmod_blob = NULL;
static const struct Vmod_vmod_blobdigest_Func *vmod_blobdigest = NULL; static const struct Vmod_vmod_blobdigest_Func *vmod_blobdigest = NULL;
...@@ -154,8 +155,11 @@ tus_b64_decode(VRT_CTX, const char *s, VCL_INT l) ...@@ -154,8 +155,11 @@ tus_b64_decode(VRT_CTX, const char *s, VCL_INT l)
{ {
struct strands st = {.n = 1, .p = &s}; struct strands st = {.n = 1, .p = &s};
if (! enabled) if (! enabled) {
VRT_fail(ctx, "base64 decode support not available - "
"vmod_blob was not found");
return (NULL); return (NULL);
}
AN(vmod_blob); AN(vmod_blob);
AN(vmod_blob->decode); AN(vmod_blob->decode);
......
...@@ -36,15 +36,13 @@ ...@@ -36,15 +36,13 @@
#include "vcc_tus_if.h" #include "vcc_tus_if.h"
#include "tus_checksums.h"
#include "tus_b64.h" #include "tus_b64.h"
#include "tus_file.h" #include "tus_file.h"
#include "tus_servers.h" #include "tus_servers.h"
#include "tus_hdr.h" #include "tus_hdr.h"
#include "tus_response.h" #include "tus_response.h"
/* tus_blob.c */
const char * tus_checksums(void);
const unsigned s_MULT = 1000; const unsigned s_MULT = 1000;
const unsigned s_OPTIONS = 1; const unsigned s_OPTIONS = 1;
const unsigned s_HEAD = 2; const unsigned s_HEAD = 2;
......
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