You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Cliff Woolley <jw...@virginia.edu> on 2002/03/08 21:33:50 UTC
Re: cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c
On 8 Mar 2002 stoddard@apache.org wrote:
> stoddard 02/03/07 20:25:30
>
> Modified: modules/experimental mod_mem_cache.c
> Log:
> Add file handle caching to mod_mem_cache. This is still experimental and
> is enabled by the #define CACHE_FD, which is off by default.
>
> @@ -102,6 +102,7 @@
> apr_size_t refcount;
> apr_size_t m_len;
> void *m;
> + apr_os_file_t fd;
> } mem_cache_object_t;
>
> typedef struct {
> @@ -163,9 +164,12 @@
>
> /* Cleanup the mem_cache_object_t */
> if (mobj) {
> - if (mobj->m) {
> + if (mobj->type == CACHE_TYPE_HEAP && mobj->m) {
> free(mobj->m);
> }
> + if (mobj->type == CACHE_TYPE_FILE && mobj->fd) {
> + apr_file_close(mobj->fd);
> + }
> if (mobj->header_out) {
> if (mobj->header_out[0].hdr)
> free(mobj->header_out[0].hdr);
mod_mem_cache.c: In function `cleanup_cache_object':
mod_mem_cache.c:171: warning: passing arg 1 of `apr_file_close' makes
pointer from integer without a cast
You can't apr_file_close() an apr_os_file_t.
--Cliff
--------------------------------------------------------------
Cliff Woolley
cliffwoolley@yahoo.com
Charlottesville, VA
Re: cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c
Posted by Bill Stoddard <bi...@wstoddard.com>.
Grrr... yep this is a bug and the MS compiler doesn't even flag a warning. Now how to fix
it... There are no clean options...
Bill
> On 8 Mar 2002 stoddard@apache.org wrote:
>
> > stoddard 02/03/07 20:25:30
> >
> > Modified: modules/experimental mod_mem_cache.c
> > Log:
> > Add file handle caching to mod_mem_cache. This is still experimental and
> > is enabled by the #define CACHE_FD, which is off by default.
> >
> > @@ -102,6 +102,7 @@
> > apr_size_t refcount;
> > apr_size_t m_len;
> > void *m;
> > + apr_os_file_t fd;
> > } mem_cache_object_t;
> >
> > typedef struct {
> > @@ -163,9 +164,12 @@
> >
> > /* Cleanup the mem_cache_object_t */
> > if (mobj) {
> > - if (mobj->m) {
> > + if (mobj->type == CACHE_TYPE_HEAP && mobj->m) {
> > free(mobj->m);
> > }
> > + if (mobj->type == CACHE_TYPE_FILE && mobj->fd) {
> > + apr_file_close(mobj->fd);
> > + }
> > if (mobj->header_out) {
> > if (mobj->header_out[0].hdr)
> > free(mobj->header_out[0].hdr);
>
> mod_mem_cache.c: In function `cleanup_cache_object':
> mod_mem_cache.c:171: warning: passing arg 1 of `apr_file_close' makes
> pointer from integer without a cast
>
>
> You can't apr_file_close() an apr_os_file_t.
>
> --Cliff
>
>
> --------------------------------------------------------------
> Cliff Woolley
> cliffwoolley@yahoo.com
> Charlottesville, VA
>
>