msgbuf: msgbuf_append_tag(): add support for attaching a specific capability bit

This commit is contained in:
William Pitcock 2016-02-13 00:19:23 -06:00
parent b4993fe8c3
commit d670fe5271
2 changed files with 3 additions and 2 deletions

View file

@ -75,12 +75,13 @@ msgbuf_init(struct MsgBuf *msgbuf)
}
static inline void
msgbuf_append_tag(struct MsgBuf *msgbuf, const char *key, const char *value)
msgbuf_append_tag(struct MsgBuf *msgbuf, const char *key, const char *value, unsigned int capmask)
{
s_assert(msgbuf->n_tags < MAXPARA);
msgbuf->tags[msgbuf->n_tags].key = key;
msgbuf->tags[msgbuf->n_tags].value = value;
msgbuf->tags[msgbuf->n_tags].capmask = capmask;
msgbuf->n_tags++;
}

View file

@ -65,7 +65,7 @@ msgbuf_parse(struct MsgBuf *msgbuf, char *line)
*eq++ = '\0';
if (*t && *t != ' ')
msgbuf_append_tag(msgbuf, t, eq);
msgbuf_append_tag(msgbuf, t, eq, 0);
else
break;