thrift-iterator / go

decode/encode thrift message without IDL
Apache License 2.0
266 stars 31 forks source link

fix: panic for some map and pointers #9

Closed jxskiss closed 6 years ago

jxskiss commented 6 years ago

Fix:

  1. panic when encoding struct with nil pointer field
  2. panic when encoding struct which has only one map field
  3. wrong bool value marshaling caused by un-reset of pendingBoolField in compact protocol
  4. return value of ReadBinary in sbinary must be copied

Change:

  1. allow encoding and decoding struct field with FieldId 0, to be compatible with apache thrift rpc response

The changed tests addressed the above issues, all have been fixed now.