summaryrefslogtreecommitdiff
path: root/src/etag.c
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2015-09-18 15:15:18 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2015-09-18 15:15:18 +0000
commit8b2630a82fbecfd57fa38aebb397a755936690e5 (patch)
treea9cfcd7bb5bea87d63fc8ef81c8456a130a249bc /src/etag.c
parente57c8295ebe92b58ca3e68fa8ea8f70d4b0b4cee (diff)
downloadlighttpd-master.tar.gz
add README to point to lighttpd-1.4.x as stableHEADmaster
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@3041 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/etag.c')
-rw-r--r--src/etag.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/etag.c b/src/etag.c
deleted file mode 100644
index 0e16c598..00000000
--- a/src/etag.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include "buffer.h"
-#include "etag.h"
-
-int etag_is_equal(buffer *etag, const char *matches) {
- if (buffer_is_equal_string(etag, matches, strlen(matches))) return 1;
- return 0;
-}
-
-int etag_create(buffer *etag, struct stat *st, etag_flags_t flags) {
-
- if (0 == flags) return 0;
-
- buffer_reset(etag);
-
- if (flags & ETAG_USE_INODE) {
- buffer_append_off_t(etag, st->st_ino);
- buffer_append_string_len(etag, CONST_STR_LEN("-"));
- }
- if (flags & ETAG_USE_SIZE) {
- buffer_append_off_t(etag, st->st_size);
- buffer_append_string_len(etag, CONST_STR_LEN("-"));
- }
- if (flags & ETAG_USE_MTIME) {
- buffer_append_long(etag, st->st_mtime);
- }
- return 0;
-}
-
-int etag_mutate(buffer *mut, buffer *etag) {
- size_t i;
- uint32_t h;
-
- for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
-
- buffer_reset(mut);
- buffer_copy_string_len(mut, CONST_STR_LEN("\""));
- buffer_append_long(mut, h);
- buffer_append_string_len(mut, CONST_STR_LEN("\""));
-
- return 0;
-}