}
/* Check "version" K/V item */
- if (sz >= strlen(SPOP_VERSION_KEY) && !memcmp(str, SPOP_VERSION_KEY, strlen(SPOP_VERSION_KEY))) {
+ if (sz == strlen(SPOP_VERSION_KEY) && !memcmp(str, SPOP_VERSION_KEY, sz)) {
int type = *p++;
/* The value must be a string */
}
}
/* Check "max-frame-size" K/V item */
- else if (sz >= strlen(SPOP_MAX_FRAME_SIZE_KEY) && !memcmp(str, SPOP_MAX_FRAME_SIZE_KEY, SPOP_SLEN(SPOP_MAX_FRAME_SIZE_KEY))) {
+ else if (sz == strlen(SPOP_MAX_FRAME_SIZE_KEY) && !memcmp(str, SPOP_MAX_FRAME_SIZE_KEY, sz)) {
int type = *p++;
/* The value must be integer */
max_frame_size = sz;
}
/* Check "capabilities" K/V item */
- else if (sz >= strlen(SPOP_CAPABILITIES_KEY) && !memcmp(str, SPOP_CAPABILITIES_KEY, SPOP_SLEN(SPOP_CAPABILITIES_KEY))) {
+ else if (sz == strlen(SPOP_CAPABILITIES_KEY) && !memcmp(str, SPOP_CAPABILITIES_KEY, sz)) {
int type = *p++;
/* The value must be a string */
}
/* Check "status-code" K/V item */
- if (sz >= strlen(SPOP_STATUS_CODE_KEY) && !memcmp(str, SPOP_STATUS_CODE_KEY, strlen(SPOP_STATUS_CODE_KEY))) {
+ if (sz == strlen(SPOP_STATUS_CODE_KEY) && !memcmp(str, SPOP_STATUS_CODE_KEY, sz)) {
int type = *p++;
/* The value must be an integer */
}
// TODO: for now skip the reason
/* /\* Check "message" K/V item *\/ */
- /* else if (sz >= strlen(SPOP_MSG_KEY) && !memcmp(str, SPOP_MSG_KEY, strlen(SPOP_MSG_KEY))) { */
+ /* else if (sz == strlen(SPOP_MSG_KEY) && !memcmp(str, SPOP_MSG_KEY, sz)) { */
/* int type = *p++; */
/* /\* The value must be a string *\/ */