apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Balazs Mezodi <am...@bonus.hu>
Subject apr_reslist question
Date Tue, 02 Sep 2003 08:30:41 GMT
hi,


  i'm new to apr, so i don't know if i ask this question at the right
place...

  i'm using the apr which is bundled with apache-2.0.47.

  how to use apr_reslist with sockets correctly? sockets are "fragile",
therefore error handling is very important:

  in apr-util/misc/apr_reslist.c the function
apr_reslist_acquire() completly ignores the return value of
create_resource() at line 370. this means that:
- the user has to find other ways to get informed about the possible
  errors occured in the reslist->constructor callback
- the reslist stores the resource as if the acquisition were successful.

  i think this is not consistent with the behaviour of
reslist_maint(), which breaks if the resource acquisition was not
successful. this might be confusing since apr_reslist_acquire() always
returns success, but apr_reslist_release() might break because of
unsuccessful resource acquisition!

  in apr/tables/apr_tables.c in apr_table_elts() at line 409 there should
be:
    return (const apr_array_header_t *)&t->a;

  the current code is working only because the member 'a' is the first one
in the structure. this might break in the future. well, at least it
deserves a short comment i think...


--
Balazs Mezodi
amebay@yahoo.com


Mime
View raw message