Bugfix: GET on incomplete file would keep it locked indefinitely

If a GET arrived before a file was complete, we would miss to unlock
it due to the fcore pointer missing in the response struct.
parent c28ca54c
......@@ -379,12 +379,13 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
r->status = 404;
return (0);
}
AN(fcore);
AN(fdisk);
if (fdisk->location_length > 0) {
/* done file */
r->fcore = fcore;
r->status = 301;
r->status = 301; /* done file */
} else {
AZ(pthread_mutex_unlock(&fcore->mtx));
r->status = 400;
}
return (0);
......
......@@ -170,6 +170,11 @@ client c2 {
expect resp.http.has-filenamee == false
expect resp.http.has-filenam == false
# failing get on upload in progress
txreq -url "/vtc"
rxresp
expect resp.status == 400
# finish upload
txreq -method PATCH -url "/vtc" \
-hdr "Tus-Resumable: 1.0.0" \
......
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