Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2290

OPMsg size for a Document Sequence is encoded as native endianness

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Currently, when the C driver writes the length of a document sequence payload in an OpMsg, it writes the length as native-endian instead of little-endian.

      Here is the problematic line:
      https://github.com/mongodb/mongo-c-driver/blob/e86e19589294b348ef8e7c547d65babb42fb089b/src/mongoc/mongoc-rpc.c#L116

      Support for document sequences was added in the change below, and did the endian encoding correctly:
      https://github.com/mongodb/mongo-c-driver/commit/c2073231209f20f5eef7263e969ae69ed47a031e
      A regression in behavior was added in this change
      https://github.com/mongodb/mongo-c-driver/commit/0f12b9d2782feef0418894bcd0134c89e21a5b5e

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: