Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-tus
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-tus
Commits
569e6d5a
Unverified
Commit
569e6d5a
authored
Jan 07, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce use of tus_servers.h
parent
a92058b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
16 deletions
+9
-16
tus_response.c
src/tus_response.c
+7
-13
tus_response.h
src/tus_response.h
+1
-2
vmod_tus.c
src/vmod_tus.c
+1
-1
No files found.
src/tus_response.c
View file @
569e6d5a
...
...
@@ -34,11 +34,8 @@
#include <cache/cache.h>
#include <vrt_obj.h>
#include "vcc_tus_if.h"
#include "tus_checksums.h"
#include "tus_file.h"
#include "tus_servers.h"
#include "tus_hdr.h"
#include "tus_response.h"
...
...
@@ -51,19 +48,19 @@ static VCL_BYTES
tus_upload_length
(
const
struct
VPFX
(
tus_server
)
*
tussrv
,
const
struct
tus_file_core
*
fcore
)
{
VCL_BYTES
max
;
VCL_BYTES
srvmax
,
max
;
struct
statvfs
fs
;
CHECK_OBJ_NOTNULL
(
tussrv
,
VMOD_TUS_SERVER_MAGIC
);
srvmax
=
tus_server_max
(
tussrv
);
if
(
fcore
!=
NULL
&&
fcore
->
fd
>=
0
)
{
if
(
fstatvfs
(
fcore
->
fd
,
&
fs
))
return
(
tussrv
->
max
);
}
else
if
(
statvfs
(
tus
srv
->
basedir
,
&
fs
))
return
(
tussrv
->
max
);
return
(
srv
max
);
}
else
if
(
statvfs
(
tus
_server_basedir
(
tussrv
)
,
&
fs
))
return
(
srv
max
);
max
=
fs
.
f_bavail
*
fs
.
f_frsize
;
return
(
max
<
tussrv
->
max
?
max
:
tussrv
->
max
);
return
(
max
<
srvmax
?
max
:
srv
max
);
}
static
void
...
...
@@ -101,7 +98,6 @@ tus_response(VRT_CTX, const struct VPFX(tus_server) *tussrv,
char
buf
[
TUS_PATH_MAX
];
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
tussrv
,
VMOD_TUS_SERVER_MAGIC
);
CHECK_OBJ_NOTNULL
(
resp
,
VMOD_TUS_RESPONSE_MAGIC
);
if
(
resp
->
fcore
)
{
fcore
=
resp
->
fcore
;
...
...
@@ -211,14 +207,12 @@ tus_response(VRT_CTX, const struct VPFX(tus_server) *tussrv,
}
VCL_BOOL
tus_done
(
VRT_CTX
,
const
struct
VPFX
(
tus_server
)
*
tussrv
,
const
struct
tus_response
*
resp
,
const
char
*
url
)
tus_done
(
VRT_CTX
,
const
struct
tus_response
*
resp
,
const
char
*
url
)
{
struct
tus_file_core
*
fcore
;
struct
tus_file_disk
*
fdisk
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
tussrv
,
VMOD_TUS_SERVER_MAGIC
);
CHECK_OBJ_NOTNULL
(
resp
,
VMOD_TUS_RESPONSE_MAGIC
);
fcore
=
resp
->
fcore
;
if
(
fcore
==
NULL
)
...
...
src/tus_response.h
View file @
569e6d5a
...
...
@@ -45,8 +45,7 @@ void
tus_response
(
VRT_CTX
,
const
struct
VPFX
(
tus_server
)
*
tussrv
,
const
struct
tus_response
*
resp
);
VCL_BOOL
tus_done
(
VRT_CTX
,
const
struct
VPFX
(
tus_server
)
*
tussrv
,
const
struct
tus_response
*
resp
,
const
char
*
url
);
tus_done
(
VRT_CTX
,
const
struct
tus_response
*
resp
,
const
char
*
url
);
VCL_BOOL
tus_meta
(
VRT_CTX
,
const
struct
tus_response
*
resp
,
const
char
*
k
,
VCL_BLOB
*
b
);
...
...
src/vmod_tus.c
View file @
569e6d5a
...
...
@@ -488,7 +488,7 @@ VCL_BOOL tus_server_done(VRT_CTX, struct VPFX(tus_server) *tussrv,
if
(
args
->
valid_location
)
url
=
args
->
location
;
return
(
tus_done
(
ctx
,
tussrv
,
r
,
url
));
return
(
tus_done
(
ctx
,
r
,
url
));
}
VCL_BOOL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment