VOL-1925, VOL-1882 affinity-router.go unit tests; fix varint skip issue
Change-Id: I0baba72351bbf026985761bf217aecfd288ccdbd
diff --git a/afrouter/afrouter/affinity-router.go b/afrouter/afrouter/affinity-router.go
index 7a3168e..7a94f7b 100644
--- a/afrouter/afrouter/affinity-router.go
+++ b/afrouter/afrouter/affinity-router.go
@@ -202,10 +202,14 @@
func (ar AffinityRouter) skipField(data *[]byte, idx *int) error {
switch (*data)[*idx] & 3 {
case 0: // Varint
+ // skip the field number/type
*idx++
+ // if the msb is set, then more bytes to follow
for (*data)[*idx] >= 128 {
*idx++
}
+ // the last byte doesn't have the msb set
+ *idx++
case 1: // 64 bit
*idx += 9
case 2: // Length delimited