Browse Source

fmt

pull/7231/head
chrislu 2 months ago
parent
commit
2c525781f8
  1. 4
      weed/mq/kafka/protocol/offset_management.go

4
weed/mq/kafka/protocol/offset_management.go

@ -414,7 +414,7 @@ func (h *Handler) parseOffsetFetchRequest(data []byte) (*OffsetFetchRequest, err
// Skip client_id (part of OffsetFetch payload) // Skip client_id (part of OffsetFetch payload)
clientIDLength := int(binary.BigEndian.Uint16(data[offset:])) clientIDLength := int(binary.BigEndian.Uint16(data[offset:]))
offset += 2 + clientIDLength offset += 2 + clientIDLength
fmt.Printf("DEBUG: OffsetFetch skipped client_id (%d bytes: '%s'), offset now: %d\n",
fmt.Printf("DEBUG: OffsetFetch skipped client_id (%d bytes: '%s'), offset now: %d\n",
clientIDLength, string(data[2:2+clientIDLength]), offset) clientIDLength, string(data[2:2+clientIDLength]), offset)
// GroupID (string) // GroupID (string)
@ -427,7 +427,7 @@ func (h *Handler) parseOffsetFetchRequest(data []byte) (*OffsetFetchRequest, err
groupID := string(data[offset : offset+groupIDLength]) groupID := string(data[offset : offset+groupIDLength])
offset += groupIDLength offset += groupIDLength
fmt.Printf("DEBUG: OffsetFetch parsed GroupID: '%s' (len=%d), offset now: %d\n", groupID, groupIDLength, offset) fmt.Printf("DEBUG: OffsetFetch parsed GroupID: '%s' (len=%d), offset now: %d\n", groupID, groupIDLength, offset)
// Fix: There's a 1-byte off-by-one error in the offset calculation // Fix: There's a 1-byte off-by-one error in the offset calculation
// This suggests there's an extra byte in the format we're not accounting for // This suggests there's an extra byte in the format we're not accounting for
offset -= 1 offset -= 1

Loading…
Cancel
Save