Handle errors from zip_meta

parent dbe5da15
...@@ -616,6 +616,7 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc) ...@@ -616,6 +616,7 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
struct zipflow_request *zfr; struct zipflow_request *zfr;
struct zipflow_top *zft; struct zipflow_top *zft;
struct req *req; struct req *req;
int r;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
(void) vdc; (void) vdc;
...@@ -633,10 +634,15 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc) ...@@ -633,10 +634,15 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
if (req->resp_len == 0) if (req->resp_len == 0)
zfr->bundle = 0; zfr->bundle = 0;
r = 0;
if (zfr->bundle) { if (zfr->bundle) {
fill_meta(ctx, zfr); fill_meta(ctx, zfr);
AZ(zip_meta(zft->zip, zfr->name, 3, zfr->mode, r = zip_meta(zft->zip, zfr->name, 3, zfr->mode,
(uint32_t)zfr->atime, (uint32_t)zfr->mtime)); (uint32_t)zfr->atime, (uint32_t)zfr->mtime);
}
if (r != 0) {
VSLb(vdc->vsl, SLT_Error, "zipflow: zip_meta returned %d", r);
return (-1);
} }
RFC2616_Weaken_Etag(req->resp); RFC2616_Weaken_Etag(req->resp);
......
...@@ -86,9 +86,31 @@ client c1 { ...@@ -86,9 +86,31 @@ client c1 {
txreq txreq
rxresp rxresp
expect resp.status == 500 expect resp.status == 500
} -run } -start
client c2 {
txreq -body {
foo=/REQ/first/file
&foo=http://thishost/path/file1&
in valid
https://invalid
// https://
&bazz=https://thishost/another/file2
&zrrr=//thishost/file3
}
rxresphdrs
expect resp.status == 200
rxchunk
rxchunk
rxchunk
} -start
logexpect l1 -wait logexpect l1 -wait
# all default # all default
shell "curl --data-raw \"/REQ/CURL/first http://thishost/path/file1 https://thishost/another/file2 //thishost/xxx/file3\" -so t.zip -H 'Host: ${v1_addr}' http://${v1_addr}:${v1_port}/ && unzip -Z t.zip" shell "curl --data-raw \"/REQ/CURL/first http://thishost/path/file1 https://thishost/another/file2 //thishost/xxx/file3\" -so t.zip -H 'Host: ${v1_addr}' http://${v1_addr}:${v1_port}/ && unzip -Z t.zip"
client c1 -wait
client c2 -wait
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