Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions