Uploaded image for project: 'Hot Rod Native client'
  1. Hot Rod Native client
  2. HRCPP-75

HotRodOperation::writeHeader should not allocate params on heap

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      The AbstractKeyValueOperation::sendPutOperation or AbstractKeyOperation::sendKeyOperation use a weird pattern of handling with the HeaderParams: In HotRodOperation::writeHeaders the params are allocated on heap and then a reference to the object is returned. sendPutOperation dereferences this reference to pointer, stores it in scoped pointer and then passes the params by reference to readHeaderAndValidate. Then the scoped pointer is destructed, deallocating the params.

      Instead, the sendPutOperation should construct the params on stack, pass it by reference to writeHeaders and then to readHeaderAndValidate. This requires a decent modification of the HotRodOperation api, but we wouldn't allocate and destroy objects on stack for each request!

      Attachments

        Activity

          People

            ttarrant@redhat.com Tristan Tarrant
            rvansa1@redhat.com Radim Vansa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: