summaryrefslogtreecommitdiffstats
path: root/src/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core.h b/src/core.h
index 0a82d2e..67c9af7 100644
--- a/src/core.h
+++ b/src/core.h
@@ -15,8 +15,6 @@ extern const char *root;
extern int max_clients;
extern int num_clients;
extern bool redirect;
-/* max_client logic only applies for files larger than 1024 bytes. */
-#define FILE_SIZE_THRESHOLD 1024ULL
enum tip_client_state {
TIP_CLIENT_PENDING = 0,
@@ -50,6 +48,7 @@ struct tip_client {
enum tip_http_method method;
const char *uri;
const char *path;
+ bool checksum;
uint32_t chunk;
off_t size;
off_t left;
@@ -67,9 +66,9 @@ static inline int tip_client_socket(const struct tip_client *cli)
return cli->io.fd;
}
-static inline bool tip_client_large_file(const struct tip_client *cli)
+static inline bool tip_client_checksum_file(const struct tip_client *cli)
{
- return cli->size > FILE_SIZE_THRESHOLD;
+ return cli->checksum;
}
void tip_client_pending(struct tip_client *cli);