Correct misunderstanding with zip64 extra records

This commit is contained in:
Justine Tunney 2023-11-18 14:35:57 -08:00
parent dbd8176ea8
commit 3e6d536822
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 96 additions and 78 deletions

View file

@ -263,7 +263,7 @@ struct Strings {
struct String {
size_t n;
const char *s;
} * p;
} *p;
};
struct DeflateGenerator {
@ -291,7 +291,7 @@ static struct Servers {
struct Server {
int fd;
struct sockaddr_in addr;
} * p;
} *p;
} servers;
static struct Freelist {
@ -305,7 +305,7 @@ static struct Unmaplist {
int f;
void *p;
size_t n;
} * p;
} *p;
} unmaplist;
static struct Psks {
@ -316,7 +316,7 @@ static struct Psks {
char *identity;
size_t identity_len;
char *s;
} * p;
} *p;
} psks;
static struct Suites {
@ -335,7 +335,7 @@ static struct Redirects {
int code;
struct String path;
struct String location;
} * p;
} *p;
} redirects;
static struct Assets {
@ -350,8 +350,8 @@ static struct Assets {
struct File {
struct String path;
struct stat st;
} * file;
} * p;
} *file;
} *p;
} assets;
static struct TrustedIps {
@ -359,7 +359,7 @@ static struct TrustedIps {
struct TrustedIp {
uint32_t ip;
uint32_t mask;
} * p;
} *p;
} trustedips;
struct TokenBucket {
@ -393,7 +393,7 @@ static struct Shared {
#undef C
} c;
pthread_spinlock_t montermlock;
} * shared;
} *shared;
static const char kCounterNames[] =
#define C(x) #x "\0"
@ -3695,8 +3695,8 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
p = WRITE16LE(p, mtime);
p = WRITE16LE(p, mdate);
p = WRITE32LE(p, crc);
p = WRITE32LE(p, MIN(uselen, 0xffffffff));
p = WRITE32LE(p, MIN(datalen, 0xffffffff));
p = WRITE32LE(p, 0xffffffffu);
p = WRITE32LE(p, 0xffffffffu);
p = WRITE16LE(p, pathlen);
p = WRITE16LE(p, v[2].iov_len);
v[1].iov_len = pathlen;
@ -3755,8 +3755,8 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
p = WRITE16LE(p, mtime);
p = WRITE16LE(p, mdate);
p = WRITE32LE(p, crc);
p = WRITE32LE(p, MIN(uselen, 0xffffffff));
p = WRITE32LE(p, MIN(datalen, 0xffffffff));
p = WRITE32LE(p, 0xffffffffu);
p = WRITE32LE(p, 0xffffffffu);
p = WRITE16LE(p, pathlen);
p = WRITE16LE(p, v[8].iov_len + v[9].iov_len);
p = WRITE16LE(p, 0);
@ -3764,7 +3764,7 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
p = WRITE16LE(p, iattrs);
p = WRITE16LE(p, dosmode);
p = WRITE16LE(p, mode);
p = WRITE32LE(p, MIN(zsize, 0xffffffff));
p = WRITE32LE(p, 0xffffffffu);
v[7].iov_len = pathlen;
v[7].iov_base = (void *)path;
// zip64 end of central directory