Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-236

url copy function should duplicate host fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0a
    • 2.0.0
    • Core
    • None

    Description

      The change for https://issues.apache.org/jira/browse/TS-185 makes sure that url_host_set() doesn't free/reallocate new memory on every call, but optimally grows the buffer. The old approach used to work as a copy-on-write mechanism when a URL object was cloned. A url_host_set() on either object decoupled the the host pointers from both objects pointing to the same location. The new approach however does not free/reallocate on every url_host_set() and there is a chance that upon cloning (which url_copy_onto() does) that both objects' host pointers will continue to point to the same location. To fix this, url_copy_onto() should duplicate the host string.

      Also from TS-185, the addition of m_capacity_host has to be changed. The new member should be added towards the end of the class as this affects unmarshalling new classes from old cache files.

      Attachments

        1. host_copy.patch
          2 kB
          Manjesh Nilange

        Activity

          People

            zwoop Leif Hedstrom
            manjesh Manjesh Nilange
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: