cvs commit: apache-1.3/src/main http_protocol.c

2000-01-04 Thread martin
martin  00/01/04 02:20:43

  Modified:src/main http_protocol.c
  Log:
  Another place where we must force EBCDIC conversion to ON
  
  Revision  ChangesPath
  1.285 +7 -0  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.284
  retrieving revision 1.285
  diff -u -r1.284 -r1.285
  --- http_protocol.c   1999/12/20 17:43:35 1.284
  +++ http_protocol.c   2000/01/04 10:20:39 1.285
  @@ -1686,6 +1686,9 @@
   API_EXPORT(void) ap_finalize_request_protocol(request_rec *r)
   {
   if (r->chunked && !r->connection->aborted) {
  +#ifdef CHARSET_EBCDIC
  + PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client, 1);
  +#endif
   /*
* Turn off chunked encoding --- we can only do this once.
*/
  @@ -1697,6 +1700,10 @@
   /* If we had footer "headers", we'd send them now */
   ap_rputs(CRLF, r);
   ap_kill_timeout(r);
  +
  +#ifdef CHARSET_EBCDIC
  + POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
  +#endif /*CHARSET_EBCDIC*/
   }
   }
   
  
  
  


cvs commit: apache-2.0/htdocs modules.html

2000-01-04 Thread dreid
dreid   00/01/04 09:14:00

  Added:   htdocs   modules.html
  Log:
  HTML doc outlining how to convert a module from 1.3 to 2.0.
  
  Not complete but at least it's a start.
  
  Revision  ChangesPath
  1.1  apache-2.0/htdocs/modules.html
  
  Index: modules.html
  ===
  
  
  
  Converting Modules from Apache 1.3 to Apache 2.0
  
  
  
  
  
  From Apache 1.3 to Apache 2.0Modules
  
  
  This is a first attempt at writing the lessons I learned when trying to 
convert the mod_mmap_static module to Apache 2.0.  It's by no means definitive 
and probably won't even be correct in some ways, but it's a start.
  
  
  The easier changes...
  
  
  Cleanup Routines
  
  These now need to be of type ap_status_t and return a value of that type.  
Normally the return value will be APR_SUCCESS unless there is some need to 
signal an error in the cleanup.  Be aware that even though you signal an error 
not all code yet checks and acts upon the error.
  
  
  Initialisation Routines
  
  
  These should now be renamed to better signify where they sit in the overall 
process.  So the name gets a small change from mmap_init to mmap_post_config.  
The arguments passed have undergone a radical change and now look like
  
  
  ap_context_t *p,
  ap_context_t *plog,
  ap_context_t *ptemp,
  server_rec *s
  
  
  Throughout Apache the old pools have been replced by the ap_context_t, though 
their use remains remarkably similar.
  
  
  Data Types
  
  A lot of the data types have been moved into the APR.  This means that some 
have had a name change, such as the one shown above.  The following is a brief 
list of some of the changes that you are likely to have to make.
  
  pool becomes ap_context_t
  table becomes ap_table_t
  
  
  
  
  The messier changes...
  
  Register Hooks
  
  The new architecture uses a series of hooks to provide for calling your 
functions.  These you'll need to add to your module by way of a new function, 
static void register_hooks(void).  The function is really reasonably 
straightforward once you understand what needs to be done.  Each function that 
needs calling at some stage in the processing of a request needs to be 
registered, handlers do not.  There are a number of phases where functions can 
be added, and for each you can specify with a high degree of control the 
relative order that the function will be called in.
  
  
  This is the code that was added to mod_mmap_static
  
  
  static void register_hooks(void)
  {
  static const char * const aszPre[]={ "http_core.c",NULL };
  ap_hook_post_config(mmap_post_config,NULL,NULL,HOOK_MIDDLE);
  ap_hook_translate_name(mmap_static_xlat,aszPre,NULL,HOOK_LAST);
  };
  
  
  This registers 2 functions that need to be called, one in the post_config 
stage (virtually every module will need this one) and one for the 
translate_name phase.  note that while there are different function names the 
format of each is identical.  So what is the format?
  
  
  ap_hook_[phase_name](function_name, predecessors, successors, position);
  
  
  There are 3 hook positions defined...
  
  
  HOOK_FIRST
  HOOK_MIDDLE
  HOOK_LAST
  
  
  To define the position you use the position and then modify it with the 
predecessors and successors.  each of the modifiers can be a list of functions 
that should be called, either before the function is run (predecessors) or 
after the function has run (successors).
  
  
  In the mod_mmap_static case I didn't care about the post_config stage, but 
the mmap_static_xlat MUST be called after the core module had done it's name 
translation, hence the use of the aszPre to define a modifier to the position 
HOOK_LAST.
  
  Module Definition
  
  
  There are now a lot fewer stages to worry about when creating your module 
definition.  The old defintion looked like
  
  
  module MODULE_VAR_EXPORT [module_name]_module =
  {
  STANDARD_MODULE_STUFF,
  /* initializer */
  /* dir config creater */
  /* dir merger --- default is to override */
  /* server config */
  /* merge server config */
  /* command handlers */
  /* handlers */
  /* filename translation */
  /* check_user_id */
  /* check auth */
  /* check access */
  /* type_checker */
  /* fixups */
  /* logger */
  /* header parser */
  /* child_init */
  /* child_exit */
  /* post read-request */
  };
  
  
  The new structure is a great deal simpler...
  
  
  module MODULE_VAR_EXPORT [module_name]_module =
  {
  STANDARD20_MODULE_STUFF,
  /* create per-directory config structures */
  /* merge per-directory config structures  */
  /* create per-server config structures*/
  /* merge per-server config structures */
  /* command handlers */
  /* handlers */
  /* register hooks */
   };
  
  
  Some of these read directly across, some don't.  I'll try to summar

cvs commit: apache-2.0/htdocs hooks.html index.html

2000-01-04 Thread dreid
dreid   00/01/04 09:26:02

  Modified:htdocs   hooks.html index.html
  Log:
  A few minor changes to the simple page provided with Apache 2.0 to allow
  links to the other 2 documents.  No doubt this will get more involved
  but at least this is a start.
  
  Revision  ChangesPath
  1.2   +19 -2 apache-2.0/htdocs/hooks.html
  
  Index: hooks.html
  ===
  RCS file: /home/cvs/apache-2.0/htdocs/hooks.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- hooks.html1999/08/15 13:50:26 1.1
  +++ hooks.html2000/01/04 17:26:01 1.2
  @@ -1,5 +1,20 @@
  -Apache Hook Functions
  +
  +
  +
  +Apache 2.0 Hook Functions
  +
  +
  +
  +
   
  +Apache Hook Functions
  +
   In general, a hook function is one that Apache will call at some
   point during the processing of a request. Modules can provide
   functions that are called, and specify when they get called in
  @@ -182,4 +197,6 @@
   by HOOK_ORDER is preserved, as far as is
   possible.
   
  -Ben Laurie, 15th August 1999
  \ No newline at end of file
  +Ben Laurie, 15th August 1999
  +
  +
  
  
  
  1.2   +3 -1  apache-2.0/htdocs/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/apache-2.0/htdocs/index.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.html1999/07/04 09:26:07 1.1
  +++ index.html2000/01/04 17:26:01 1.2
  @@ -3,6 +3,8 @@
   Simple Page for Apache-MPM
   
   
  -Simple Page for Apache-MPM
  +Simple Page for Apache-MPM
  +Apache Hook Functions
  +Converting Apache 1.3 Modules to Apache 2.0
   
   
  
  
  


cvs commit: apache-2.0/src/modules/standard mod_asis.c mod_autoindex.c mod_cgi.c mod_cgid.c mod_include.c mod_mime_magic.c mod_negotiation.c mod_rewrite.c

2000-01-04 Thread rbb
rbb 00/01/04 11:01:13

  Modified:src/lib/apr/file_io/unix filestat.c open.c
   src/lib/apr/include apr_file_io.h
   src/lib/apr/test abc.c testfile.c testmmap.c testproc.c
   src/main buff.c http_config.c http_log.c util.c
   src/modules/experimental mod_mmap_static.c
   src/modules/mpm/prefork prefork.c
   src/modules/standard mod_asis.c mod_autoindex.c mod_cgi.c
mod_cgid.c mod_include.c mod_mime_magic.c
mod_negotiation.c mod_rewrite.c
  Log:
  Initialize all ap_file_t's to NULL.  This allows ap_open and ap_stat to
  work together without causing memory leaks.
  
  Revision  ChangesPath
  1.5   +1 -1  apache-2.0/src/lib/apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- filestat.c2000/01/03 20:57:20 1.4
  +++ filestat.c2000/01/04 19:00:42 1.5
  @@ -92,7 +92,7 @@
* arg 2) The name of the file to stat.
* arg 3) the context to use to allocate the new file. 
*/ 
  -ap_status_t ap_stat(struct file_t **thefile, char *fname, ap_context_t *cont)
  +ap_status_t ap_stat(struct file_t **thefile, const char *fname, ap_context_t 
*cont)
   {
   struct stat info;
   int rv = stat(fname, &info);
  
  
  
  1.30  +3 -1  apache-2.0/src/lib/apr/file_io/unix/open.c
  
  Index: open.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- open.c1999/12/31 01:16:53 1.29
  +++ open.c2000/01/04 19:00:42 1.30
  @@ -104,7 +104,9 @@
   int oflags = 0;
   char *buf_oflags;
   
  -(*new) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t));
  +if ((*new) == NULL) {
  +(*new) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t));
  +}
   
   (*new)->cntxt = cont;
   (*new)->oflags = oflags;
  
  
  
  1.25  +1 -1  apache-2.0/src/lib/apr/include/apr_file_io.h
  
  Index: apr_file_io.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_file_io.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- apr_file_io.h 2000/01/03 19:47:44 1.24
  +++ apr_file_io.h 2000/01/04 19:00:44 1.25
  @@ -132,7 +132,7 @@
   ap_status_t ap_make_iov(ap_iovec_t **, struct iovec *, ap_context_t *);
   ap_status_t ap_dupfile(ap_file_t **, ap_file_t *);
   ap_status_t ap_getfileinfo(ap_file_t *);
  -ap_status_t ap_stat(ap_file_t **thefile, char *fname, ap_context_t *cont);
  +ap_status_t ap_stat(ap_file_t **thefile, const char *fname, ap_context_t 
*cont);
   ap_status_t ap_seek(ap_file_t *, ap_seek_where_t, ap_off_t *);
   
   ap_status_t ap_opendir(ap_dir_t **, const char *, ap_context_t *);
  
  
  
  1.6   +1 -1  apache-2.0/src/lib/apr/test/abc.c
  
  Index: abc.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/abc.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- abc.c 1999/10/14 14:36:35 1.5
  +++ abc.c 2000/01/04 19:00:47 1.6
  @@ -6,7 +6,7 @@
   
   int main(int argc, char *argv[])
   {
  -ap_file_t *fd;
  +ap_file_t *fd = NULL;
   char ch;
   int status = 0;
   ap_context_t *context;
  
  
  
  1.8   +2 -2  apache-2.0/src/lib/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testfile.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- testfile.c1999/10/15 14:20:19 1.7
  +++ testfile.c2000/01/04 19:00:49 1.8
  @@ -210,7 +210,7 @@
   
   int test_filedel(ap_context_t *context)
   {
  -ap_file_t *thefile;
  +ap_file_t *thefile = NULL;
   ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
   ap_status_t stat;
 
  @@ -238,7 +238,7 @@
   int testdirs(ap_context_t *context)
   {
   ap_dir_t *temp;  
  -ap_file_t *file;
  +ap_file_t *file = NULL;
   ap_ssize_t bytes;
   ap_filetype_e type;
   char *fname;
  
  
  
  1.5   +1 -1  apache-2.0/src/lib/apr/test/testmmap.c
  
  Index: testmmap.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testmmap.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- testmmap.c1999/12/15 12:20:40 1.4
  +++ testmmap.c2000/01/04 19:00:49 1.5
  @@ -70,7 +70,7 @@
   {

cvs commit: apache-2.0/src/lib/apr/file_io/unix filestat.c

2000-01-04 Thread rbb
rbb 00/01/04 12:46:49

  Modified:src/lib/apr/file_io/unix filestat.c
  Log:
  If ap_stat allocates space for a file, then ap_stat also has to register
  a cleanup.
  
  Revision  ChangesPath
  1.6   +3 -0  apache-2.0/src/lib/apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- filestat.c2000/01/04 19:00:42 1.5
  +++ filestat.c2000/01/04 20:46:48 1.6
  @@ -106,6 +106,9 @@
   if ((*thefile) == NULL) {
   return APR_ENOMEM;
   }
  +(*thefile)->cntxt = cont;
  +ap_register_cleanup((*thefile)->cntxt, (void *)(*thefile),
  +file_cleanup, ap_null_cleanup);
   (*thefile)->fname = ap_pstrdup(cont, fname);
   (*thefile)->filehand = NULL;
   (*thefile)->filedes = -1;
  
  
  


cvs commit: apache-site/info apache_books.html

2000-01-04 Thread lars
lars00/01/04 15:09:53

  Modified:info apache_books.html
  Log:
  add link
  
  Revision  ChangesPath
  1.19  +2 -1  apache-site/info/apache_books.html
  
  Index: apache_books.html
  ===
  RCS file: /export/home/cvs/apache-site/info/apache_books.html,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- apache_books.html 2000/01/02 05:49:27 1.18
  +++ apache_books.html 2000/01/04 23:09:49 1.19
  @@ -29,7 +29,8 @@
   

 
  -   Apache: Das umfassende Referenzwerk.
  +   http://www.oreilly.de/catalog/apacheger/";
  +   >Apache: Das umfassende Referenzwerk.
  Author: Ben Laurie, Peter Laurie

Published by: O'Reilly and Associates, Germany