Attached is a `git-format-patch`-formatted patch with some extra strduping and freeing.
On Fri, Oct 30, 2015 at 11:39 PM, Willy Tarreau <[email protected]> wrote: > Hi James, > > On Wed, Oct 28, 2015 at 10:27:22AM -0700, James Brown wrote: > > Sorry for being thickheaded, Willy, but what's your decision here ??? do > you > > want me to make it per-Backend instead of per-Server, or do you want to > > merge it as-is? > > Well, I think we can take it as-is then. The per-server setting doesn't > block the ability to later add a per-backend setting anyway. However you > need to fix one point in the patch : the string must be allocated per > server (so that we don't cause double-free when releasing it on exit). > Please use strdup() to allocate the string from the default server, and > please call free() on the server's string before assigning a new one, so > that we don't leak small memory chunks when setting multiple default-server > entries. Same when creating a new proxy (look for "fwdfor_hdr_name" as a > hit about where you should have to free(defproxy->agent_send). Also please > ensure that you properly assign the string from the default proxy's > default-server to the current proxy's. fwdfor_hdr_name is properly set > regarding this so you won't have to search too long. > > Last point, please build your patch using "git format-patch", so that I > can simply apply it. You used "git show", which is sufficient for a review > but requires manual modifications. If you have a single patch in your > branch, you can simply use "git format-patch -1" and you'll get the patch > for the latest commit. > > Thanks! > Willy > > -- James Brown Engineer
0001-Add-agent-send-server-parameter.patch
Description: Binary data

