Re: [PATCH] add ap_brigade_insert_file()

2004-11-04 Thread Justin Erenkrantz
--On Thursday, November 4, 2004 10:07 PM + Joe Orton <[EMAIL PROTECTED]> 
wrote:

This factors out the logic for correctly inserting a file into a
brigade, doing the special little dance for large files if necessary;
the code was already duplicated twice and it's needed in other places
too.  (pervasive largefile support being my top 2.1 goal :)
*nod*
Any comments, naming preferences, "put it in apr-util you twit" flames?
"Put it in apr-util, you marvelous angel."  Pretty please with sugar on top...
Looks fine otherwise... =)  -- justin


Re: [PATCH] add ap_brigade_insert_file()

2004-11-04 Thread Cliff Woolley
On Thu, 4 Nov 2004, Joe Orton wrote:

> This factors out the logic for correctly inserting a file into a
> brigade, doing the special little dance for large files if necessary;
> the code was already duplicated twice and it's needed in other places
> too.  (pervasive largefile support being my top 2.1 goal :)

Amen, brother.  Thank you!  :)

> Any comments, naming preferences, "put it in apr-util you twit" flames?

I'd have absolutely no objection to that.  Sounds like a fabulous idea
actually.

--Cliff


Re: [PATCH] add ap_brigade_insert_file()

2004-11-04 Thread Thom May
* Joe Orton ([EMAIL PROTECTED]) wrote :
> This factors out the logic for correctly inserting a file into a
> brigade, doing the special little dance for large files if necessary;
> the code was already duplicated twice and it's needed in other places
> too.  (pervasive largefile support being my top 2.1 goal :)
> 
> Any comments, naming preferences, "put it in apr-util you twit" flames?
> 
I suspect I'd like to see it in apr-util, but I'd hesitate to call you a
twit :-)
(and change the name accordingly)
Otherwise, looks good.
Cheers,
-Thom


[PATCH] add ap_brigade_insert_file()

2004-11-04 Thread Joe Orton
This factors out the logic for correctly inserting a file into a
brigade, doing the special little dance for large files if necessary;
the code was already duplicated twice and it's needed in other places
too.  (pervasive largefile support being my top 2.1 goal :)

Any comments, naming preferences, "put it in apr-util you twit" flames?

Index: include/util_filter.h
===
RCS file: /home/cvs/httpd-2.0/include/util_filter.h,v
retrieving revision 1.92
diff -u -r1.92 util_filter.h
--- include/util_filter.h   31 Oct 2004 18:00:43 -  1.92
+++ include/util_filter.h   4 Nov 2004 21:53:57 -
@@ -489,6 +489,22 @@
  apr_bucket_brigade **b, apr_pool_t *p);
 
 /**
+ * Utility function to insert a file of given length onto the end of
+ * the brigade.  The file is split into multiple buckets if it is
+ * larger than the maximum size which can be represented by a single bucket.
+ * @param bb the brigade to insert into
+ * @param f the file to insert
+ * @param start the offset into the file
+ * @param len the length of the file to insert
+ * @param p pool from which file buckets are allocated
+ * @return the last bucket inserted
+ */
+AP_DECLARE(apr_bucket *) ap_brigade_insert_file(apr_bucket_brigade *bb,
+apr_file_t *f, apr_off_t start,
+apr_off_t len, apr_pool_t *p);
+
+
+/**
  * Flush function for apr_brigade_* calls.  This calls ap_pass_brigade
  * to flush the brigade if the brigade buffer overflows.
  * @param bb The brigade to flush
Index: modules/experimental/mod_disk_cache.c
===
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
retrieving revision 1.68
diff -u -r1.68 mod_disk_cache.c
--- modules/experimental/mod_disk_cache.c   4 Nov 2004 21:51:12 -   1.68
+++ modules/experimental/mod_disk_cache.c   4 Nov 2004 21:53:59 -
@@ -502,14 +502,10 @@
 
 static apr_status_t recall_body(cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade 
*bb)
 {
-apr_bucket *e;
 disk_cache_object_t *dobj = (disk_cache_object_t*) h->cache_obj->vobj;
 
-e = apr_bucket_file_create(dobj->fd, 0, (apr_size_t) dobj->file_size, p,
-   bb->bucket_alloc);
-APR_BRIGADE_INSERT_HEAD(bb, e);
-e = apr_bucket_eos_create(bb->bucket_alloc);
-APR_BRIGADE_INSERT_TAIL(bb, e);
+ap_brigade_insert_file(bb, dobj->fd, 0, dobj->file_size, p);
+APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_eos_create(bb->bucket_alloc));
 
 return APR_SUCCESS;
 }
Index: modules/generators/mod_asis.c
===
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_asis.c,v
retrieving revision 1.51
diff -u -r1.51 mod_asis.c
--- modules/generators/mod_asis.c   9 Feb 2004 20:29:19 -   1.51
+++ modules/generators/mod_asis.c   4 Nov 2004 21:53:59 -
@@ -76,7 +76,6 @@
 
 if (!r->header_only) {
 apr_bucket_brigade *bb;
-apr_bucket *b;
 apr_off_t pos = 0;
 
 rv = apr_file_seek(f, APR_CUR, &pos);
@@ -89,30 +88,8 @@
 }
 
 bb = apr_brigade_create(r->pool, c->bucket_alloc);
-#if APR_HAS_LARGE_FILES
-if (r->finfo.size - pos > AP_MAX_SENDFILE) {
-/* APR_HAS_LARGE_FILES issue; must split into mutiple buckets, 
- * no greater than MAX(apr_size_t), and more granular than that
- * in case the brigade code/filters attempt to read it directly.
- */
-apr_off_t fsize = r->finfo.size - pos;
-b = apr_bucket_file_create(f, pos, AP_MAX_SENDFILE,
-   r->pool, c->bucket_alloc);
-while (fsize > AP_MAX_SENDFILE) {
-APR_BRIGADE_INSERT_TAIL(bb, b);
-apr_bucket_copy(b, &b);
-b->start += AP_MAX_SENDFILE;
-fsize -= AP_MAX_SENDFILE;
-}
-b->length = (apr_size_t)fsize; /* Resize just the last bucket */
-}
-else
-#endif
-b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos),
-   r->pool, c->bucket_alloc);
-APR_BRIGADE_INSERT_TAIL(bb, b);
-b = apr_bucket_eos_create(c->bucket_alloc);
-APR_BRIGADE_INSERT_TAIL(bb, b);
+ap_brigade_insert_file(bb, f, pos, (apr_size_t) (r->finfo.size - pos), 
+   r->pool);
 rv = ap_pass_brigade(r->output_filters, bb);
 if (rv != APR_SUCCESS) {
 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
Index: server/core.c
===
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.292
diff -u -r1.292 core.c
--- server/core.c   4 Nov 2004 16:04:55 -   1.292

RE: [PATCH]Re: Adding a new user DN cache to authnz_ldap...

2004-11-04 Thread Brad Nicholes
Good point.  I will get the patch committed

Brad

>>> "Jari Ahonen" <[EMAIL PROTECTED]> Thursday, November 04, 2004
7:39:01 AM >>>
Brad,

I think this patch should be applied to the current HEAD
util_ldap.c code. It prevents util_ldap_cache_getuserdn()
timestamping cache entries with bindpw.

- Jari

- cut here - cut here -
--- util_ldap.c.orig2004-11-02 00:43:24.0 +0100
+++ util_ldap.c 2004-11-04 15:34:23.0 +0100
@@ -1096,7 +1096,12 @@
 /* Nothing in cache, insert new entry */
 util_ald_cache_insert(curl->search_cache,
&the_search_node);
 }
-else {
+/*
+ * Don't update lastbind on entries with bindpw because
+ * we haven't verified that password. It's OK to update
+ * the entry if there is no password in it.
+ */
+else if (!search_nodep->bindpw) {
 /* Cache entry is valid, update lastbind */
 search_nodep->lastbind = the_search_node.lastbind;
 }
- cut here - cut here -
> 


Seeking review of tiny but useful patch: Bug #29740, --with-apr=/usr is broken

2004-11-04 Thread Max Bowsher
BugZilla link:
http://issues.apache.org/bugzilla/show_bug.cgi?id=29740
The linked bug contains a very simple patch, for a bug which prevents the 
use of --with-apr=/usr.

Please, could someone take a look at it, and commit it?
It's only 7 touched lines in a single file, so should be quick to do.
Max.


Re: [PATCH]: LDAP Authz (was: Ldap Authorization)

2004-11-04 Thread Graham Leggett
Brad Nicholes wrote:
According to the LDAP docs, doing an ldap_compare_s() is
faster than an ldap_search_s().  I will go ahead an commit the patch
as-is and also propose a backport for it.  But I think that we should
look at adding a "require ldap-filter" directive as well for Apache
2.1/2.2.
+1
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature