Use consistent int types for APM fields and snprintf for string conversions

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Several things I noticed dating back to the original implementation in PHPC-349:

      • Structs use uint64_t for fields where libmongoc's API returns int64_t. It's unlikely that these values would ever be negative, but we should keep the original type.
      • Request and operation ID are printed as unsigned strings. If a negative value was returned by libmongoc for some reason, this would alter it.
      • Printing request and operation ID uses sprintf. Although it's unlikely we'd overflow the string buffer, it'd be safer to use snprintf as we do in the ZVAL_INT64_STRING macro.

      I came across this while working on PHPC-2143.

              Assignee:
              Jeremy Mikola
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: