apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <i...@cnet.com>
Subject Re: [PATCH] apr_dbm -- db fix
Date Mon, 17 Sep 2001 18:42:48 GMT
On Mon, 2001-09-17 at 11:44, Mladen Turk wrote:
> Hi,
> Small patch to fix the APU_USE_DB that causes wrong apr_dbm_nextkey reading.
> DB->seq returns RET_SPECIAL when the cursor passes last record so...
> infinite loop.
> 
> 
how does this patch affect db3?
> Index: apr_dbm.c
> ===================================================================
> RCS file: /home/cvspublic/apr-util/dbm/apr_dbm.c,v
> retrieving revision 1.27
> diff -u -r1.27 apr_dbm.c
> --- apr_dbm.c	2001/08/29 18:34:05	1.27
> +++ apr_dbm.c	2001/09/17 18:25:58
> @@ -257,6 +257,10 @@
> 
>  #if DB_VER == 1
>      dberr = (*f->bdb->seq)(f->bdb, pkey, &data, R_NEXT);
> +    if (dberr == RET_SPECIAL) {
> +        pkey->data = NULL;
> +        pkey->size = 0;
> +    }
>  #else
>      if (f->curs == NULL)
>          return APR_EINVAL;
> @@ -553,7 +557,7 @@
> 
>      CONVERT_DATUM(ckey, pkey);
>      rv = APR_DBM_NEXTKEY(dbm->file, ckey, rd);
> -    RETURN_DATUM(pkey, rd);
> +    RETURN_DATUM(pkey, ckey);
> 
>      REGISTER_CLEANUP(dbm, pkey);
> 
> 
> MT.
-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 364-8608


Mime
View raw message