Commit f7207935 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Ohh, this tiny men with their mighty machines:

Increase the ID field in the shmlog records from 16 to 32 bits to cater
for 64k+ connections.

Both varnishd and libvarnishapi needs to be recompiled, but apps should
not need to.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4264 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent b16d7f49
......@@ -86,10 +86,11 @@ vsl_hdr(enum shmlogtag tag, unsigned char *p, unsigned len, unsigned id)
assert(loghead->magic == SHMLOGHEAD_MAGIC);
assert(len < 0x10000);
assert(id < 0x10000);
p[__SHMLOG_LEN_HIGH] = (len >> 8) & 0xff;
p[__SHMLOG_LEN_LOW] = len & 0xff;
p[__SHMLOG_ID_HIGH] = (id >> 8) & 0xff;
p[__SHMLOG_ID_HIGH] = (id >> 24) & 0xff;
p[__SHMLOG_ID_MEDHIGH] = (id >> 16) & 0xff;
p[__SHMLOG_ID_MEDLOW] = (id >> 8) & 0xff;
p[__SHMLOG_ID_LOW] = id & 0xff;
p[SHMLOG_DATA + len] = '\0';
p[SHMLOG_NEXTTAG + len] = SLT_ENDMARKER;
......
......@@ -73,7 +73,7 @@ struct shmloghead {
*
* 1 byte field type (enum shmlogtag)
* 2 bytes length of contents
* 2 bytes record identifier
* 4 bytes record identifier
* n bytes field contents (isgraph(c) || isspace(c)) allowed.
*/
......@@ -81,12 +81,18 @@ struct shmloghead {
#define __SHMLOG_LEN_HIGH 1
#define __SHMLOG_LEN_LOW 2
#define __SHMLOG_ID_HIGH 3
#define __SHMLOG_ID_LOW 4
#define SHMLOG_DATA 5
#define SHMLOG_NEXTTAG 6 /* ... + len */
#define __SHMLOG_ID_MEDHIGH 4
#define __SHMLOG_ID_MEDLOW 5
#define __SHMLOG_ID_LOW 6
#define SHMLOG_DATA 7
#define SHMLOG_NEXTTAG 8 /* ... + len */
#define SHMLOG_LEN(p) (((p)[__SHMLOG_LEN_HIGH] << 8) | (p)[__SHMLOG_LEN_LOW])
#define SHMLOG_ID(p) (((p)[__SHMLOG_ID_HIGH] << 8) | (p)[__SHMLOG_ID_LOW])
#define SHMLOG_ID(p) ( \
((p)[__SHMLOG_ID_HIGH] << 24) | \
((p)[__SHMLOG_ID_MEDHIGH] << 16) | \
((p)[__SHMLOG_ID_MEDLOW] << 8) | \
(p)[__SHMLOG_ID_LOW])
/*
* The identifiers in shmlogtag are "SLT_" + XML tag. A script may be run
......
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