Re: appsession fix

From: Willy Tarreau <w#1wt.eu>
Date: Fri, 15 Feb 2008 23:54:36 +0100


On Thu, Feb 14, 2008 at 02:46:44PM -0700, Ryan Warnick wrote:
> Sounds good. How about that first change that I proposed (the bug fix)?

I've just checked the code, and while I think you're right, I think that there are two other places with exactly similar code which need this patch too :

What do you think ? Aleks, do you agree with me ?

> Here is the diff -u:

Thanks. Just for your info, a diff -u is generally done above the top of the project so that the version appears as the first directory component. It then applies within the project with "patch -p1". And if you don't want to go above the project, doing "diff -u ./src/proto_http.c{.orig,}" is fine too because "patch -p1" will strip "./" and the patch will apply.

> --- proto_http.c.orig 2008-02-12 14:25:15.000000000 -0700
> +++ proto_http.c.new 2008-02-14 14:28:03.000000000 -0700
> @@ -4607,7 +4607,8 @@
> asession_temp->serverid = NULL;
>
> /* only do insert, if lookup fails */
> - if (appsession_hash_lookup(&(t->be->htbl_proxy),
> asession_temp->sessid) == NULL) {
> + asession_temp = appsession_hash_lookup(&(t->be->htbl_proxy),
> asession_temp->sessid);
> + if (asession_temp == NULL)
> if ((asession_temp = pool_alloc2(pool2_appsess)) == NULL) {
> /* free previously allocated memory */
> pool_free2(apools.sessid, local_asession.sessid);
>

Thanks,
Willy Received on 2008/02/15 23:54

This archive was generated by hypermail 2.2.0 : 2008/02/16 00:01 CET