1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

153 Commits

Author SHA1 Message Date
Jeff Trawick
f96aba98f9 change the way that thread id is specified in the log format since
the previous implementation used a format string already taken
by mod_logio

now, an optional %P format is used instead

thanks to Andre' Malo for pointing out that I chose a format string
already used by mod_logio!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99442 13f79535-47bb-0310-9956-ffa450edef68
2003-04-18 19:40:11 +00:00
Jeff Trawick
5d79cd7197 mod_log_config: Add the ability to log the id of the thread
processing the request (%I).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99439 13f79535-47bb-0310-9956-ffa450edef68
2003-04-18 10:44:11 +00:00
William A. Rowe Jr
1e7b7d79bb SECURITY: Eliminated leaks of several file descriptors to child
processes, such as CGI scripts.

PR: 17206
Submitted by:	Christian Kratzer <ck@cksoft.de>, Bjoern A. Zeeb <bz@zabbadoz.net>
Reviewed by:	Joe Orton, Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99032 13f79535-47bb-0310-9956-ffa450edef68
2003-03-20 21:50:40 +00:00
André Malo
c8185c253b Minor MMN bump:
Forward port: Escape special characters (especially control
characters) in mod_log_config to make a clear distinction between
client-supplied strings (with special characters) and server-side
strings. This was already introduced in version 1.3.25.

Obtained from: Patch in 1.3.25-dev by Martin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98912 13f79535-47bb-0310-9956-ffa450edef68
2003-03-06 23:53:52 +00:00
Ian Holsman
7f5768e187 change optional function to return the previous writer, allowing to have mutliple types
of writers in the same server. (previously you could only have one)

it needs a mmn bump.. sorry guys
;(


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98648 13f79535-47bb-0310-9956-ffa450edef68
2003-02-14 04:17:34 +00:00
William A. Rowe Jr
cb16c9fcfd Tabs. Runovers. Style violations ... oh my!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98638 13f79535-47bb-0310-9956-ffa450edef68
2003-02-13 13:54:04 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
William A. Rowe Jr
a4b9d1c913 Accept '%%' in CustomLog format strings to produce a literal '%'.
Submitted by: Andr� Malo <nd@perlig.de>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97644 13f79535-47bb-0310-9956-ffa450edef68
2002-11-25 15:39:56 +00:00
Jeff Trawick
6f67265758 static-ize a function which is not supposed to be exported
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96835 13f79535-47bb-0310-9956-ffa450edef68
2002-09-16 12:43:36 +00:00
William A. Rowe Jr
822b5eb746 Revisit the code that Ian and I discussed on list. Actually pre-flight
the access logs so that failure conditions are noted earlier, and return
  out of the code using the != OK convention from ap_hook_open_logs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96828 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 21:37:32 +00:00
William A. Rowe Jr
894f2c0b75 Return mismatches... this solution simply won't work, as Ian reminded me.
Needs more work/time I don't have this afternoon, reverting to r 1.91


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96816 13f79535-47bb-0310-9956-ffa450edef68
2002-09-14 20:54:16 +00:00
William A. Rowe Jr
de2a40c0cc At least follow the proper failure path for failure to open the log file
or logging process.  Doesn't fix the lack of preflight testing.

Reviewed by: Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96814 13f79535-47bb-0310-9956-ffa450edef68
2002-09-14 20:36:30 +00:00
Ian Holsman
f2ef7ec192 change the log_writer declaration so that it takes a request_rec instead of
just a pool.
(so that the writer can get to things like hostname)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96666 13f79535-47bb-0310-9956-ffa450edef68
2002-09-06 03:00:11 +00:00
Ian Holsman
9db23288f2 its >>FNAME<< not >>name<<
doh


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96547 13f79535-47bb-0310-9956-ffa450edef68
2002-08-27 17:20:29 +00:00
Jeff Trawick
2e1a0ec6e2 make the type of the variable explicit to quiet a gcc warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96544 13f79535-47bb-0310-9956-ffa450edef68
2002-08-27 11:18:57 +00:00
Ian Holsman
e1cb208344 introduce 2 new callback oppurtunities to allow a 3rd party module to do
the actual writing of the log file.
also change buffered writing to make it runtime configurable instead of
compile time configurable.

i'm not 100% on the buffered output, mainly because I'm not sure it worked
in a thread safe way *before* this change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96538 13f79535-47bb-0310-9956-ffa450edef68
2002-08-26 23:23:45 +00:00
Jeff Trawick
0fd67ef418 use APR_TIME_T_FMT when formatting apr_time_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96099 13f79535-47bb-0310-9956-ffa450edef68
2002-07-17 16:08:53 +00:00
Brian Pane
980fac58f3 Replaced APR_USEC_PER_SEC division with the new apr_time_sec() macro
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95915 13f79535-47bb-0310-9956-ffa450edef68
2002-06-30 03:53:32 +00:00
Justin Erenkrantz
001b387bcd Change conn_rec->keepalive to an enumerated value of
AP_CONN_UNKNOWN
AP_CONN_CLOSE
AP_CONN_KEEPALIVE

This also fixes a problem where ap_discard_request_body would not discard
the body when keepalive was 0.  This actually meant the keepalive status
was unknown *not* closed, but no one ever remembered that.

This problem was seen with mod_dav sending error responses (as reported by
Karl Fogel).

Suggested by:	Greg "this isn't the '80s" Stein
Reviewed by:	Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95891 13f79535-47bb-0310-9956-ffa450edef68
2002-06-26 19:45:07 +00:00
Brian Pane
a343e3c5cb My logger timestamp cache was using an apr_time_t as the cache key.
apr_time_t has a resolution of 1 microsecond.

For some reason, the cache hit rate wasn't very high.  :-)

With this change, the cache key is now the time in seconds, not usec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95588 13f79535-47bb-0310-9956-ffa450edef68
2002-06-09 04:48:41 +00:00
William A. Rowe Jr
178e10e3da Well the wrappers work out well... nice to be able to put off committing
these API changes until the evening ;)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95587 13f79535-47bb-0310-9956-ffa450edef68
2002-06-09 03:44:03 +00:00
William A. Rowe Jr
d53d71c887 Hmmm... gotta ask the wisdom in using aspecific types over apr_time_*_t
types.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95068 13f79535-47bb-0310-9956-ffa450edef68
2002-05-13 20:17:31 +00:00
Brian Pane
e6819f9589 Added caching of formatted timestamps to speed up the access logger when
using standard time format


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95046 13f79535-47bb-0310-9956-ffa450edef68
2002-05-12 08:09:13 +00:00
William A. Rowe Jr
65a37752ec Eliminate potential ap_server_root_relative segfaults, with the input
of Jeff Trawick's style changes to the first patches.  Doesn't include
  the fixes to ssl [more complex], and we won't trap errors that involve
  ap_serverroot, since we presume that was normalized on the way in.
  Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases
  should never become necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93965 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:26:58 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Ian Holsman
da35725071 apr-utils rename apr_ansi_time_to_apr_time and
apr_exploded_time_t.

PR:
Obtained from:
Submitted by:	Thom May <thom@planetarytramp.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93733 13f79535-47bb-0310-9956-ffa450edef68
2002-03-06 17:55:38 +00:00
Aaron Bannert
d5fdaf9cfd The pre_config hook now takes a return value. This allows modules to
cause the server to bail out under error conditions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93063 13f79535-47bb-0310-9956-ffa450edef68
2002-01-28 23:49:40 +00:00
Ian Holsman
71de760992 wrowe's veto'd this.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92798 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 03:23:33 +00:00
Ian Holsman
23360cd007 new option LogExcludeByType
main use is so that you can ignore logging images
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92792 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 01:03:41 +00:00
Brian Pane
3b76538d51 Rearranged the log_request_time() code to eliminate the allocation
of an 8KB buffer on the stack when not using a custom time format


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92758 13f79535-47bb-0310-9956-ffa450edef68
2002-01-06 21:03:51 +00:00
Brian Pane
8894b833f2 Bypass a strdup and an 8KB local variable in the common case where
the logger is using the default time format


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92752 13f79535-47bb-0310-9956-ffa450edef68
2002-01-06 08:01:34 +00:00
Brian Pane
9d445c8f58 Replaced an instance of apr_pool_userdata_setn() with apr_pool_userdata_set()..
the value of "userdata_key" is an address on the stack when compiled with
gcc 2.95.3 on Solaris/Sparc, so storing the address directly in the hash
table is unsafe.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92497 13f79535-47bb-0310-9956-ffa450edef68
2001-12-16 09:54:14 +00:00
Ian Holsman
c7c6e876a9 change open_logs hook to return a value, allowing you to flag a error
while opening logs

Obtained from: Doug MacEachern


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92149 13f79535-47bb-0310-9956-ffa450edef68
2001-11-24 00:08:30 +00:00
William A. Rowe Jr
da3ae7591e Use the _setn flavor which will avoid strdup'ing these strings, and
skip the cleanups we don't need.

Submitted by: Brian Pane <bpane@pacbell.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91681 13f79535-47bb-0310-9956-ffa450edef68
2001-10-29 15:19:03 +00:00
Justin Erenkrantz
867166bede The call to apr_explode_localtime() in mod_log_config is one of the more
expensive operations in the httpd.  This patch attempts to reduce the
overhead by caching the result for 15 seconds.

Submitted by:	Brian Pane <bpane@pacbell.net>
Reviewed by:	Cliff Woolley, Ryan Bloom, Dean Gaudet, Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91083 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 06:53:26 +00:00
Victor J. Orlikowski
76692f2573 Fix a case where on restart, an admin started logging, and the logging
code waited to start until the second pass (assuming we were just starting
up) to open the log file. Also fix a typo.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90737 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 20:50:01 +00:00
William A. Rowe Jr
f1a4bc7d04 *) Changed the late-1.3 log_config substitution %c to %X (logs the
status of the closed connection) as it conflicts with the far more
     common, historical ssl logging directive %...{var}c.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90417 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 19:43:03 +00:00
Doug MacEachern
2090fa8748 adjust to apr_uri_ rename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90361 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 16:01:05 +00:00
Cliff Woolley
de7d0daac0 Fix printf() warnings related to long->apr_off_t swap
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89738 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 18:40:27 +00:00
William A. Rowe Jr
5b71e358f3 Change the length of the content args to apr_off_t identifiers, and fix
mod_negotation to treat a size of -1 and indeterminate, instead of 0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89727 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 15:53:15 +00:00
Greg Ames
9ffcdaf02b Reduce CPU consumption in conv_10 function, used to format "%d" by apr_*printf
This includes two changes to APR:
  * new functions apr_itoa, apr_ltoa, and apr_off_t_toa
    that provide itoa-type functionality based on pools
  * Inline code in inet_ntop4 to replace sprintf for converting
    binary IP addresses into dotted-decimal format

and two changes to Apache:
  * use the apr_itoa functions in setting the content length,
    in place of apr_psprintf
  * use the apr_itoa functions to replace frequent uses of
    'sprintf("%d",...)' in mod_log_config.

Submitted by: Brian Pane
Reviewed by:  Dean Gaudet, Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89686 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 22:55:29 +00:00
William A. Rowe Jr
1501c81198 Remove last public vestigages of APR_INHERIT
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89600 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 19:41:20 +00:00
William A. Rowe Jr
1fa29a8d2d Obvious files that need inheritance, correct me if I'm wrong.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89561 13f79535-47bb-0310-9956-ffa450edef68
2001-07-16 21:07:40 +00:00
Roy T. Fielding
43b9634ceb Moved util_uri to apr-util/uri/apr_uri, which means adding the apr_
prefix to all of the uri functions (yuck), changing some includes,
and using APR error codes instead of HTTP-specific error codes.

Other notes to test this patch:
- You need to delete the util_uri.h file - exports picks up on this.
- I'd like to remove the apr_uri.h from httpd.h, but that might
  increase the complexity of this patch even further.  Once this patch
  is accepted (in some form), then I can focus on removing apr_uri.h
  from httpd.h entirely.  I need baby steps (heh) right now.
- I imagine that this might break a bunch of stuff in Win32 or other OS
  builds with foreign dependency files.  Any help here is appreciated.

This is a start...  -- justin

Submitted by:	Justin Erenkrantz
Reviewed by:	Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89198 13f79535-47bb-0310-9956-ffa450edef68
2001-05-22 01:31:12 +00:00
Bill Stoddard
97833cf137 Do not start piped log processes during the config file
preflight.  This change also circumvents a problem on
Windows where the rotatelog processes created during preflight
was not getting cleaned up properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89127 13f79535-47bb-0310-9956-ffa450edef68
2001-05-16 13:49:40 +00:00
Bill Stoddard
cebc827303 mod_log_config: %c connection status incorrectly logged
as "-" (non-keepalive) when MaxKeepAliveRequests is set to 0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88974 13f79535-47bb-0310-9956-ffa450edef68
2001-05-02 13:37:22 +00:00
Ryan Bloom
6b5c21005a Put the keep-alive connection logging back.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88910 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 22:17:59 +00:00
Roy T. Fielding
4647e5f71a Revert the change that moved keepalives out of conn_rec. That variable
controls the number of requests per connection, regardless of the protocol
used by the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88908 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 12:23:37 +00:00
Bill Stoddard
2617b1c540 Fix seg fault at start-up introduced by Ryan's change to enabl
modules to specify their own logging tags. mod_log_config
registers an optional function, ap_register_log_handler().
ap_register_log_handler() was being called by http_core before
the directive hash table was created. This patch creates the
directive hash table before ap_register_log_handler() is
registered as an optional function.

Submitted by:  [jean-frederic clere <jfrederic.clere@fujitsu-siemens.com>]
Reviewed by:  Jeff Trawick, Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88904 13f79535-47bb-0310-9956-ffa450edef68
2001-04-20 17:59:05 +00:00
Ryan Bloom
dadd829c60 Allow modules to specify their own logging format specifier. Basically,
mod_log_config has registered an optional function, that other modules
can use to specify a function to be called.  This is analogous to the way
that mod_include works.  This also allows http to do the connection
logging itself, without exposing HTTP specific pieces to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88888 13f79535-47bb-0310-9956-ffa450edef68
2001-04-18 21:06:07 +00:00