Skip to content

Buffer.wire_for doesn't cope with packed+repeated fields #61

@systemed

Description

@systemed

The wire type for packed, repeated fields is 2 (reference).

Currently, Buffer.wire_for parses the field type only, regardless of whether the field is packed+repeated. It'll therefore fail when decoding a packed+repeated field.

Quick fix is to add an extra line to Decode.decode in beefcake.rb:

      exp = Buffer.wire_for(fld.type)
      if fld.rule == :repeated && fld.opts[:packed] then exp = 2 end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions