* Take care for the case where nkey is NULL
PR: 69358
Reported by: <zhora.budyukin111 gmail.com>
Submitted by: rpluem
Reviewed by: jailletc36, rjung, jorton
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1923247 13f79535-47bb-0310-9956-ffa450edef68
*) dbm: Split the loading of a dbm driver from the opening of a dbm file. When
an attempt to load a dbm driver fails, log clearly which driver triggered
the error (not "default"), and what the error was.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898590 13f79535-47bb-0310-9956-ffa450edef68
APR and APU must be at least 1.3 to be able to configure and build httpd 2.4.x.
So remove some osbolete #if in the source code.
- mod_socache_memcache
- mod_authn_dbd
- mod_log_config
- mod_proxy_ftp and proxy-util
Submitted by: jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, icing, rpluem
Backported by: jailletc36
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898393 13f79535-47bb-0310-9956-ffa450edef68
mod_socache_shmcb: be safe from socache_shmcb_destroy() late call. PR 59798.
ssl_init_Module() in post_config early registers ssl_init_ModuleKill(), which
will then run after all the next cleanups registered later in post_config, thus
any shm_cleanup() registered from ssl_scache_init::socache_shmcb_init().
This can cause a double SHM cleanup when apr_shm_destroy() is called from
ssl_init_ModuleKill::ssl_scache_kill() as pconf is cleared.
Fix this in mod_socache_shmcb by registering a socache_shmcb_cleanup() after
the SHM is created, and by letting socache_shmcb_destroy() run the cleanup,
such that shm_cleanup() is always and ever called only once.
Ideally apr_shm_create() would be consistent accross platforms to register its
shm_cleanup() on the pool but that's not the case for now (I'm on it), so httpd
has to call apr_shm_destroy() explicitely from several places (we'll be able to
remove ssl_scache_kill() and other similar cleanups once the minimal APR
version required by httpd is fixed..).
We could also fix this by registering ssl_init_ModuleKill() late(r) in
ssl_init_Module(), though the more robust mod_socache_shmcb the better for
all the modules..
Reviewed by: ylavic, icing, rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889798 13f79535-47bb-0310-9956-ffa450edef68
Merge r1787229 from trunk
- core: print r->uri during failure
Merge r1842919 from trunk
- core: Call va_end before returning in the error case
Merge r1842926 from trunk
- mod_cache_disk: fix a Coverity warning
Merge r1856490 from trunk
- core: Provide TEST_CHAR macro in test_char.h
Merge r1862051 from trunk
- tag some pools
Merge r1864865 from trunk
- core: Fix a signed/unsigned comparison that can never match
Merge r1865871 from trunk
- mod_session: leave a hint about session expiration at TRACE2
Merge r1867256 from trunk
- mod_ssl: Fix a typo
Submitted by: covener,jorton,jorton,ylavic,jorton,jailletc36,covener,jailletc36
Reviewed by: jailletc36, jim, ylavic
Backported by: jailletc36
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1870261 13f79535-47bb-0310-9956-ffa450edef68
*) cache_storage: be consistent when building a cache key value when CacheKeyBaseURL is used with
an URL that contains a :port.
PR 53915 [Rein Tollevik <rein basefarm.no>]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1863317 13f79535-47bb-0310-9956-ffa450edef68
*) easy patches to synch 2.4.x and trunk:
- core: extend description of r->hostname
- mod_proxy_http: Avoid memory allocation before making sure that this handler can handle the URL
- core: Save a few cycles in 'ap_parse_form_data()'
- mod_cache_socache: Save some cycles
- mod_proxy_ftp: Save some cycle
- vhost: move an assignment to the end of the loop to ease readability and please a compiler
- core: Be a little more verbose when an error in trigerred in 'ap_set_file_slot()'
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1863316 13f79535-47bb-0310-9956-ffa450edef68
And the socache provider interface for Redis
And provide some nice usage stats. Could be prettier, for sure.
Needs LOGNO #s
reorganize mod_socache_redis so it compiles w/o apr-redis
It looks like this was the original intent. The provider
is not registered if apr-redis is missing.
It was previously failing to compile due to the dirconf being
hidden behind the #ifdef guard but not the routine module
code that used it.
Fix some HTML tags
</br> --> <br />
Couls also be <br> or <br/> but some (very) old clients don't like it.
httpd is not really consistent on it. (personnlaly <br> would be just fine for me but <br /> is the most commonly used form)
related to http://svn.apache.org/viewvc?view=revision&revision=1774602
Use apr_pcalloc in the 'create' function. All the fields are initialized in the 'init' function, but it is It is cleaner and more future proof.
Small style correction (remove extra spaces)
Initial doc for the sosache_redis module.
Corrections and improvements welcome.
Update compatibility notes for mod_socache_redis
Submitted by: jim, covener, jailletc36, jim, jailletc36, jailletc36, jailletc36
Reviewed by: jim, minfrin, covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855817 13f79535-47bb-0310-9956-ffa450edef68
mod_cache_socache: avoid pool to heap reallocation.
Below some threshold, the previous code tried free (sub-)pooled memory ASAP by
moving small buffers (< capacity / 2) to a heap bucket. But this is not really
an optimization because first it requires at some point to allocate more than
the configured capacity, and second since this happens during response handling
the pool is about to be destroyed soon anymay.
This commit simply keeps the data in the subpool and uses a pool bucket for the
output brigade to take care of the lifetime until it's consumed (or not).
Follow up to r1853874: CHANGES entry.
Submitted by: ylavic
Reviewed by: ylavic, icing, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855407 13f79535-47bb-0310-9956-ffa450edef68
header value RFC compliant like the case of an
Expires time in the past: allow to overwrite the
non-caching decision using CacheStoreExpired and
respect Cache-Control "max-age" and "s-maxage".
Backport of r1833876 from trunk.
Submitted by: rjung
Reviewed by: rjung, ylavic, rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1834241 13f79535-47bb-0310-9956-ffa450edef68
Log a warning when the LDAP authn provider is configured but an AuthLDAPURL
isn't -- IOW, avoid silently skipping a misconfigured [or buggy?] LDAP provider.
Follow up to r1772919: update APLOGNO().
Save a few cycles.
'apr_pstrcatv' can compute the length of the new string for us.
Improve indentation
Group bit field values in order to save some memory.
Add an explicit NULL to initialise a field in an authn_provider structure, as done in all other places. PR 60636
Submitted by: covener, ylavic, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, jim, ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1800268 13f79535-47bb-0310-9956-ffa450edef68
Use apr_pstrmemdup instead of apr_pstrndup when applicable
Remove a useless break + tiny style fix (missing space)
'repl' is already allocated in the request pool by 'construct_host_header()' the line just before.
So this is safe to use the 'apr_table_setn' variant in order to save a few bytes of memory.
Fix some tiny style issues (missing space)
Save a few bytes in the request pool.
Submitted by: jailletc36
Reviewed by: jailletc36, ylavic, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1789393 13f79535-47bb-0310-9956-ffa450edef68
mod_cache: Fix a regression in 2.4.25 for the forward proxy case by
computing and using the same entity key according to when the cache
checks, loads and saves the request. PR 60577.
Submitted by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1788511 13f79535-47bb-0310-9956-ffa450edef68
Add ../generators to include path for Windows
build of mod_socache_memcache. It now needs
mod_status.h.
Untested but exactly analogous to what works for
mod_socache_shmcb and others.
Submitted by: rjung
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1774643 13f79535-47bb-0310-9956-ffa450edef68
recognize the "default handler name" in r->handler, which is used when
no SetHandler/AddHandler and no matching mimetype during type_checker.
Submitted by: Eric Covener
mod_cache: try to use the key of a possible open but stale cache entry
if we have one in cache_try_lock(). PR 50317
Submitted by: Ruediger Pluem
* modules/cache/mod_socache_memcache.c (socache_mc_store): Pass
through expiration time.
Submitted by: Faidon Liambotis <paravoid debian.org>, jorton
* mod_cache: Preserve the Content-Type in case of 304 response.
304 does not contain Content-Type and mod_mime regenerates
the Content-Type based on the r->filename. This later leads to original
Content-Type to be lost (overwriten by whatever mod_mime generates).
mod_cache: Use the actual URI path and query-string for identifying the
cached entity (key), such that rewrites are taken into account when
running afterwards (CacheQuickHandler off). PR 21935.
mod_cache: follow up to r1756553: log the real/actual cached URI (debug).
better s-maxage support
+ *) mod_cache: Consider Cache-Control: s-maxage in expiration
+ calculations. [Eric Covener]
+
+ *) mod_cache: Allow caching of responses with an Expires header
+ in the past that also has Cache-Control: max-age or s-maxage.
+ PR55156. [Eric Covener]
remove dead code leftover from r1023387.
Prior to this revision, there was an apr_atoi64 in this context.
Now, ap_cache_control() sets control.max_age (which is checked here) when
the maxage value was parsed OK.
duplicate debug-level AH00764 in the just-validated path.
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
Submitted by: jkaluza, jorton, jkaluza, ylavic, ylavic, covener, covener, covener, wrowe
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1772331 13f79535-47bb-0310-9956-ffa450edef68
compilation on win32 (haven't worked out the clean patch
to apr/build/fixwin32mak.pl for this, yet).
This caused no issues in the 2.4.20 package, and does not
block a release.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1738140 13f79535-47bb-0310-9956-ffa450edef68
Going forwards, keep win32 build in svn once a tree is stable.
Visual Studio 2010 users cannot convert our .dsp files, and
ddk toolchain users couldn't either.
Applies the same logic as r1100294 on the 2.2.x branch.
Until the cmake build schema is entirely mature, these files
are needed for command-line builds of the 2.4 tree, and are
expected to change very little until the EOL of 2.4 branch.
The .dsp source files are not directly usable for any shipping
version of MSVC/Visual Studio (post-Visual Studio 97 release),
while the .mak exports of these projects are usable on any flavor
of the MS nmake build environment. The .dsp source files are
retained for those users wishing to import these projects into
the modern vcproj/sln file format.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1736270 13f79535-47bb-0310-9956-ffa450edef68
mod_cache_socache: Fix a possible cached entity body corruption when it
is received from an origin server in multiple batches and forwarded by
mod_proxy.
Upstream buckets should be setaside when saving response body (store_body),
but since those will finally be flatten in the cache buffer (commit_entity),
let's save them directly into the buffer to avoid heap allocation(s) and
the final copy.
Reported by: Mike Pastore <mike oobak.org>
Submitted by: ylavic
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1731082 13f79535-47bb-0310-9956-ffa450edef68
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Add a blank line between functions.
Remove some useless 'return' statements.
Fix style and alignment.
Remove some useless 'return' statements.
Fix style.
Remove some useless 'return' statements.
Add a blank line between functions.
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Remove some useless 'return' statements.
Submitted by: jailletc36
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1722180 13f79535-47bb-0310-9956-ffa450edef68
Fix some spurious ident spotted by sparse
Silence a sparse warning about inconsistent indenting
Silence a sparse warning about inconsistent indenting
Silence a sparse warning about inconsistent indenting
Silence a sparse warning about inconsistent indenting
Silence a sparse warning about inconsistent indenting
Silence a sparse warning about inconsistent indenting + some minor style issues
Remove useless line
Silence a sparse warning about inconsistent indenting + some minor style issues
Silence a sparse warning about inconsistent indenting + some minor style issues
Silence a sparse warning about inconsistent indenting + some minor style issues
Fix some spurious ident spotted by sparse
Silence a sparse warning about inconsistent indenting + some minor style issues
Silence a sparse warning about inconsistent indenting + some minor style issues
Submitted by: jailletc36
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1701772 13f79535-47bb-0310-9956-ffa450edef68
With the current implementation, it is likely to connect/close a socket with the memcache server for each command sent.
The root cause is a too small idle timeout (600 microseconds).
Add a new directive, 'MemcacheConnTTL', to control this idle connection timeout with the memcache server(s).
Change the default value from 600 usec (!) to 15 sec as per Yann suggestion.
I've limited accepted values from 1 to 1800 seconds (half an hour) because internaly, the value passed to 'apr_memcache_server_create' is still in mirco-seconds.
PR 58091
~~~~~~~~~~~~~~~~~~~_
Homemade measurement (on a slighly modified version of httpd) shows a +30% in number of processed requests using memcache to cache /index.html.
Comparison made between the 600 usec and 15 sec TTL.
Memcache config:
default
httpd Config:
CacheEnable socache /
CacheSocache memcache:127.0.0.1
LoadModule mpm_event_module modules/mod_mpm_event.so
httpd compiled with:
./configure --enable-mpms-shared=all --with-included-apr --with-mysql --with-libxml2 --enable-modules=reallyall --enable-ssl-ct=no --enable-maintainer-mode --prefix=$HOME/httpd-2.5
httpd and memcache running on the same VM running under Ubuntu 15.04
Load tested using:
ab -n 20000 http://127.0.0.1/index.html
Creation/closing of connections beetween httpd and memcache confirmed using the telnet connection to memcache and the stats command
Allow 0 as a valid value (never close idle connections)
Increased maximum allowed value to 3600 s (1 hour)
Use 'ap_timeout_parameter_parse' to allow more flexible configuration (i.e. h, min, s, ms suffixes)
Use 'apr_time_from_sec' when applicable.
Submitted by: jailletc36
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1701771 13f79535-47bb-0310-9956-ffa450edef68