Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1823

[c] make it easier to send a message

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • proton-c-0.22.0
    • proton-c-0.23.0
    • proton-c
    • None

    Description

      Encapsulates the awkward allocate-encode-expand dance required by pn_message_encode()
      Supports the following 2 scenarios:

      1. Simple: don't care about allocations, just send `pn_message_t *msg` and forget it:

          pn_message_send(msg, sender, NULL)

      2. Efficient: re-use a buffer, buffer is allocated and expanded as required:

          pn_rwbytes_t buffer={0};     // Zero initialize, libary will do the allocation
          ...
          pn_message_send(msg, sender, &buffer); // Expand as needed
          pn_message_send(msg2, sender2, &buffer); // etc.
          ...
          free(buffer->start);        // Application must do final free of buffer

      Attachments

        Activity

          People

            aconway Alan Conway
            aconway Alan Conway
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: