/[mod_czs]/mod_czs.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /mod_czs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dpavlin, Wed Aug 9 19:43:30 2000 UTC revision 1.9 by dpavlin, Thu Aug 10 13:39:31 2000 UTC
# Line 28  Line 28 
28  #include "http_config.h"  #include "http_config.h"
29  #include "http_log.h"  #include "http_log.h"
30  #include "http_protocol.h"  #include "http_protocol.h"
31    #include "translate.c"
32    
33  module MODULE_VAR_EXPORT mod_czs;  module MODULE_VAR_EXPORT mod_czs;
34    
# Line 50  static int czs_handler(request_rec *r) { Line 51  static int czs_handler(request_rec *r) {
51                  ap_log_reason("file permissions deny server access", r->filename, r);                  ap_log_reason("file permissions deny server access", r->filename, r);
52                  return FORBIDDEN;                      return FORBIDDEN;    
53          }          }
54    #ifdef DEBUG
55          if(r->args != 0 || do_czs) {          if(r->args != 0 || do_czs) {
56                  ap_table_setn(r->headers_out, "X-czs_filename", r->filename);                  ap_table_setn(r->headers_out, "X-czs_filename", r->filename);
57                    ap_table_setn(r->headers_out, "X-czs_content-type", r->content_type);
58                  if (r->args != 0) {                  if (r->args != 0) {
59                          ap_table_setn(r->headers_out, "X-czs_args", r->args);                          ap_table_setn(r->headers_out, "X-czs_args", r->args);
60                  }                  }
61          }          }
62    #endif
63    
64          ap_soft_timeout("send", r);  #ifdef TEST_QUERYSTRINGV
65          ap_send_http_header(r);          if(r->args == 0 && !do_czs || strstr(r->content_type,"cgi") != NULL) {
     
         if(r->header_only) {  
                 ap_kill_timeout(r);  
                 ap_pfclose(r->pool, in);  
                 return OK;  
         }  
   
 #ifdef TEST_QUERYSTRING  
         if(r->args == 0 && !do_czs) {  
66  #else  #else
67          if(!do_czs) {          if(!do_czs || strstr(r->content_type,"cgi") != NULL) {
68  #endif  #endif
69                  ap_send_fd(in, r);                  return DECLINED;
70    /*              ap_send_fd(in, r); */
71          } else {          } else {
72    
73                    ap_soft_timeout("send", r);
74                    ap_send_http_header(r);
75      
76                    if(r->header_only) {
77                            ap_kill_timeout(r);
78                            ap_pfclose(r->pool, in);
79                            return OK;
80                    }
81    
82                  while(fgets(buffer,MAX_STRING_LEN,in)) {                  while(fgets(buffer,MAX_STRING_LEN,in)) {
83                          for(i=0; i<MAX_STRING_LEN && buffer[i]; i++) {                          for(i=0; i<MAX_STRING_LEN && buffer[i]; i++) {
84                                  switch ( buffer[i] ) {                                  switch ( buffer[i] ) {
# Line 98  static int czs_handler(request_rec *r) { Line 103  static int czs_handler(request_rec *r) {
103          return OK;          return OK;
104  }  }
105    
 int translate_path(request_rec *r) {  
         char *uri = r->uri;  
         request_rec *subr;  
         do_czs=0;  
   
         if (uri[0]=='/' && uri[1]=='c' && uri[2]=='z' && uri[3]=='s') {  
 #if 0  
                 ap_table_setn(r->headers_out, "Location", ap_pstrcat(r->pool, uri+2, "?czs", NULL));  
                 return REDIRECT;  
 #endif  
                 subr = (request_rec *) ap_sub_req_lookup_uri(r->uri+4, r);  
                 r->filename=ap_pstrdup(r->pool, subr->filename);  
                 ap_destroy_sub_req(subr);  
                 do_czs=1;  
                 return OK;  
         }  
   
         return DECLINED;  
 }  
       
106  /* Dispatch list of content handlers */  /* Dispatch list of content handlers */
107  static const handler_rec czs_handlers[] = {  static const handler_rec czs_handlers[] = {
108    { "czs", czs_handler },    { "czs", czs_handler },
# Line 145  module MODULE_VAR_EXPORT czs_module = { Line 130  module MODULE_VAR_EXPORT czs_module = {
130      NULL,               /* child_init                          */      NULL,               /* child_init                          */
131      NULL,               /* child_exit                          */      NULL,               /* child_exit                          */
132      NULL                /* [#0] post read-request              */      NULL                /* [#0] post read-request              */
133    #ifdef EAPI
134       ,NULL,               /* EAPI: add_module                    */
135        NULL,               /* EAPI: remove_module                 */
136        NULL,               /* EAPI: rewrite_command               */
137        NULL                /* EAPI: new_connection                */
138    #endif
139  };  };
140    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.26