tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/ajp/ajplib/test ajp_header.c ajp_header.h Makefile ajp.h
Date Wed, 28 Jul 2004 14:43:46 GMT
jfclere     2004/07/28 07:43:46

  Modified:    ajp/ajplib/test Makefile ajp.h
  Added:       ajp/ajplib/test ajp_header.c ajp_header.h
  Log:
  Add the building/reading of the headers.
  
  Revision  Changes    Path
  1.3       +6 -3      jakarta-tomcat-connectors/ajp/ajplib/test/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/Makefile,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Makefile	27 Jul 2004 15:23:19 -0000	1.2
  +++ Makefile	28 Jul 2004 14:43:46 -0000	1.3
  @@ -1,27 +1,30 @@
   #
   # You need an installed httpd-2.x to use this Makefile
   #
  +
   APACHE_DIR=/home2/apache20/apache20
   APR_DIR=$(APACHE_DIR)
   APU_DIR=$(APACHE_DIR)
   
  +include $(APR_DIR)/build/config_vars.mk
  +
   # in httpd-2.x sources...
   #APR_DIR=$(APACHE_DIR)/srclib/apr
   #APU_DIR=$(APACHE_DIR)/srclib/apr-util
   
   APR_INCLUDE=$(APR_DIR)/include
   APU_INCLUDE=$(APU_DIR)/include
  +APA_INCLUDE=$(APACHE_DIR)/include
   
   SRC_DIR=.
   INCLUDE=.
  -AJP_OBJECTS = ajp_link.lo  ajp_msg.lo  httpd_wrap.lo
  +AJP_OBJECTS = ajp_link.lo  ajp_msg.lo  httpd_wrap.lo ajp_header.lo
   AJP_PROGRAM = testajp.lo
   AJP_LIB     = lib_ajp.la
   
  -INCLUDES = -I $(INCLUDE) -I $(APR_INCLUDE) -I $(APU_INCLUDE)
  +INCLUDES = -I $(INCLUDE) -I $(APR_INCLUDE) -I $(APU_INCLUDE) -I $(APA_INCLUDE)
   
   include $(APR_DIR)/build/apr_rules.mk
  -include $(APR_DIR)/build/config_vars.mk
   
   all: testajp
   
  
  
  
  1.6       +8 -0      jakarta-tomcat-connectors/ajp/ajplib/test/ajp.h
  
  Index: ajp.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/ajp.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ajp.h	28 Jul 2004 07:44:43 -0000	1.5
  +++ ajp.h	28 Jul 2004 14:43:46 -0000	1.6
  @@ -55,6 +55,14 @@
   
   #ifdef AJP_USE_HTTPD_WRAP
   #include "httpd_wrap.h"
  +#else
  +#include "httpd.h"
  +#include "http_config.h"
  +#include "http_request.h"
  +#include "http_core.h"
  +#include "http_protocol.h"
  +#include "http_main.h"
  +#include "http_log.h"
   #endif
   
   struct ajp_msg
  
  
  
  1.1                  jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.c
  
  Index: ajp_header.c
  ===================================================================
  /*
   *  Copyright 1999-2004 The Apache Software Foundation
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  
  #include "ajp_header.h"
  #include "ajp.h"
  
  static const char *response_trans_headers[] = {
      "Content-Type", 
      "Content-Language", 
      "Content-Length", 
      "Date", 
      "Last-Modified", 
      "Location", 
      "Set-Cookie", 
      "Set-Cookie2", 
      "Servlet-Engine", 
      "Status", 
      "WWW-Authenticate"
  };
  
  static const char *long_res_header_for_sc(int sc) 
  {
      const char *rc = NULL;
      if(sc <= SC_RES_HEADERS_NUM && sc > 0) {
          rc = response_trans_headers[sc - 1];
      }
  
      return rc;
  }
  
  
  static apr_status_t sc_for_req_method(const char    *method,
                               unsigned char *sc) 
  {
      apr_status_t rc = APR_SUCCESS;
      if(0 == strcmp(method, "GET")) {
          *sc = SC_M_GET;
      } else if(0 == strcmp(method, "POST")) {
          *sc = SC_M_POST;
      } else if(0 == strcmp(method, "HEAD")) {
          *sc = SC_M_HEAD;
      } else if(0 == strcmp(method, "PUT")) {
          *sc = SC_M_PUT;
      } else if(0 == strcmp(method, "DELETE")) {
          *sc = SC_M_DELETE;
      } else if(0 == strcmp(method, "OPTIONS")) {
          *sc = SC_M_OPTIONS;
      } else if(0 == strcmp(method, "TRACE")) {
          *sc = SC_M_TRACE;
      } else if(0 == strcmp(method, "PROPFIND")) {
          *sc = SC_M_PROPFIND;
      } else if(0 == strcmp(method, "PROPPATCH")) {
          *sc = SC_M_PROPPATCH;
      } else if(0 == strcmp(method, "MKCOL")) {
          *sc = SC_M_MKCOL;
      } else if(0 == strcmp(method, "COPY")) {
          *sc = SC_M_COPY;
      } else if(0 == strcmp(method, "MOVE")) {
          *sc = SC_M_MOVE;
      } else if(0 == strcmp(method, "LOCK")) {
          *sc = SC_M_LOCK;
      } else if(0 == strcmp(method, "UNLOCK")) {
          *sc = SC_M_UNLOCK;
      } else if(0 == strcmp(method, "ACL")) {
          *sc = SC_M_ACL;
      } else if(0 == strcmp(method, "REPORT")) {
          *sc = SC_M_REPORT;
      } else if(0 == strcmp(method, "VERSION-CONTROL")) {
          *sc = SC_M_VERSION_CONTROL;
      } else if(0 == strcmp(method, "CHECKIN")) {
          *sc = SC_M_CHECKIN;
      } else if(0 == strcmp(method, "CHECKOUT")) {
          *sc = SC_M_CHECKOUT;
      } else if(0 == strcmp(method, "UNCHECKOUT")) {
          *sc = SC_M_UNCHECKOUT;
      } else if(0 == strcmp(method, "SEARCH")) {
          *sc = SC_M_SEARCH;
      } else if(0 == strcmp(method, "MKWORKSPACE")) {
          *sc = SC_M_MKWORKSPACE;
      } else if(0 == strcmp(method, "UPDATE")) {
          *sc = SC_M_UPDATE;
      } else if(0 == strcmp(method, "LABEL")) {
          *sc = SC_M_LABEL;
      } else if(0 == strcmp(method, "MERGE")) {
          *sc = SC_M_MERGE;
      } else if(0 == strcmp(method, "BASELINE-CONTROL")) {
          *sc = SC_M_BASELINE_CONTROL;
      } else if(0 == strcmp(method, "MKACTIVITY")) {
          *sc = SC_M_MKACTIVITY;
      } else {
          rc = APR_EGENERAL;
      }
  
      return rc;
  }
  
  static apr_status_t sc_for_req_header(const char     *header_name,
                               unsigned short *sc) 
  {
      switch((tolower(header_name[0]))) {
          case 'a':
              if('c' ==tolower(header_name[1]) &&
                 'c' ==tolower(header_name[2]) &&
                 'e' ==tolower(header_name[3]) &&
                 'p' ==tolower(header_name[4]) &&
                 't' ==tolower(header_name[5])) {
                  if ('-' == header_name[6]) {
                      if(!strcasecmp(header_name + 7, "charset")) {
                          *sc = SC_ACCEPT_CHARSET;
                      } else if(!strcasecmp(header_name + 7, "encoding")) {
                          *sc = SC_ACCEPT_ENCODING;
                      } else if(!strcasecmp(header_name + 7, "language")) {
                          *sc = SC_ACCEPT_LANGUAGE;
                      } else {
                          return APR_EGENERAL;
                      }
                  } else if ('\0' == header_name[6]) {
                      *sc = SC_ACCEPT;
                  } else {
                      return APR_EGENERAL;
                  }
              } else if (!strcasecmp(header_name, "authorization")) {
                  *sc = SC_AUTHORIZATION;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          case 'c':
              if(!strcasecmp(header_name, "cookie")) {
                  *sc = SC_COOKIE;
              } else if(!strcasecmp(header_name, "connection")) {
                  *sc = SC_CONNECTION;
              } else if(!strcasecmp(header_name, "content-type")) {
                  *sc = SC_CONTENT_TYPE;
              } else if(!strcasecmp(header_name, "content-length")) {
                  *sc = SC_CONTENT_LENGTH;
              } else if(!strcasecmp(header_name, "cookie2")) {
                  *sc = SC_COOKIE2;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          case 'h':
              if(!strcasecmp(header_name, "host")) {
                  *sc = SC_HOST;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          case 'p':
              if(!strcasecmp(header_name, "pragma")) {
                  *sc = SC_PRAGMA;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          case 'r':
              if(!strcasecmp(header_name, "referer")) {
                  *sc = SC_REFERER;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          case 'u':
              if(!strcasecmp(header_name, "user-agent")) {
                  *sc = SC_USER_AGENT;
              } else {
                  return APR_EGENERAL;
              }
          break;
  
          default:
              return APR_EGENERAL;
      }
  
      return APR_SUCCESS;
  }
  
  
  /*
   * Message structure
   *
   *
  AJPV13_REQUEST/AJPV14_REQUEST=
      request_prefix (1) (byte)
      method         (byte)
      protocol       (string)
      req_uri        (string)
      remote_addr    (string)
      remote_host    (string)
      server_name    (string)
      server_port    (short)
      is_ssl         (boolean)
      num_headers    (short)
      num_headers*(req_header_name header_value)
  
      ?context       (byte)(string)
      ?servlet_path  (byte)(string)
      ?remote_user   (byte)(string)
      ?auth_type     (byte)(string)
      ?query_string  (byte)(string)
      ?jvm_route     (byte)(string)
      ?ssl_cert      (byte)(string)
      ?ssl_cipher    (byte)(string)
      ?ssl_session   (byte)(string)
      ?ssl_key_size  (byte)(int)      via JkOptions +ForwardKeySize
      request_terminator (byte)
      ?body          content_length*(var binary)
  
   */
  
  static apr_status_t ajp_marshal_into_msgb(ajp_msg_t    *msg,
                                   request_rec *r)
  {
      unsigned char method;
      unsigned i;
      apr_byte_t is_ssl;
      short num_headers=0;
      char *remote_host;
      
  
      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                           "Into ajp_marshal_into_msgb");
  
      if (!sc_for_req_method(r->method, &method)) { 
          ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                 "Error ajp_marshal_into_msgb - No such method %s",
                 r->method);
          return APR_EGENERAL;
      }
  
      /* XXXX need something */
      is_ssl = (apr_byte_t) 0; /* s->is_ssl */
  
      if (r->headers_in && apr_table_elts(r->headers_in)) {
          const apr_array_header_t *t = apr_table_elts(r->headers_in);
          num_headers = t->nelts;
      }
      remote_host = (char *)ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_HOST,
NULL);
  
      if (ajp_msg_append_uint8(msg, AJP13_FORWARD_REQUEST)         ||
          ajp_msg_append_uint8(msg, method)                        ||
          ajp_msg_append_string(msg, r->protocol)                  ||
          ajp_msg_append_string(msg, r->uri)                       ||
          ajp_msg_append_string(msg, r->connection->remote_ip)     ||
          ajp_msg_append_string(msg, remote_host)                  ||
          ajp_msg_append_string(msg, ap_get_server_name(r))        ||
          ajp_msg_append_uint16(msg, (apr_uint16_t)r->connection->local_addr->port)
||
          ajp_msg_append_uint8(msg, is_ssl)                        ||
          ajp_msg_append_uint16(msg, (apr_uint16_t) num_headers)) {
  
          ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                 "Error ajp_marshal_into_msgb - "
                 "Error appending the message begining");
          return APR_EGENERAL;
      }
  
      for (i = 0 ; i < num_headers ; i++) {
          unsigned short sc;
          const apr_array_header_t *t = apr_table_elts(r->headers_in);
          const apr_table_entry_t *elts = (apr_table_entry_t *)t->elts;
  
          if (sc_for_req_header(elts[i].key, &sc)) {
              if (ajp_msg_append_uint16(msg, sc)) {
                  ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                         "Error ajp_marshal_into_msgb - "
                         "Error appending the header name");
                  return APR_EGENERAL;
              }
          } else {
              if (ajp_msg_append_string(msg, elts[i].key)) {
                  ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                         "Error ajp_marshal_into_msgb - "
                         "Error appending the header name");
                  return APR_EGENERAL;
              }
          }
          
          if (ajp_msg_append_string(msg, elts[i].val)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the header value");
              return APR_EGENERAL;
          }
      }
  
  /* XXXX need to figure out how to do this
      if (s->secret) {
          if (ajp_msg_append_uint8(msg, SC_A_SECRET) ||
              ajp_msg_append_string(msg, s->secret)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending secret");
              return APR_EGENERAL;
          }
      }
   */
          
      if (r->user) {
          if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) ||
              ajp_msg_append_string(msg, r->user)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the remote user");
              return APR_EGENERAL;
          }
      }
      if (r->ap_auth_type) {
          if (ajp_msg_append_uint8(msg, SC_A_AUTH_TYPE) ||
              ajp_msg_append_string(msg, r->ap_auth_type)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the auth type");
              return APR_EGENERAL;
          }
      }
      /* XXXX  ebcdic (args converted?) */
      if (r->args) {
          if (ajp_msg_append_uint8(msg, SC_A_QUERY_STRING) ||
              ajp_msg_append_string(msg, r->args)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the query string");
              return APR_EGENERAL;
          }
      }
  /* XXXX ignored for the moment
      if (s->jvm_route) {
          if (ajp_msg_append_uint8(msg, SC_A_JVM_ROUTE) ||
              ajp_msg_append_string(msg, s->jvm_route)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the jvm route");
              return APR_EGENERAL;
          }
      }
      if (s->ssl_cert_len) {
          if (ajp_msg_append_uint8(msg, SC_A_SSL_CERT) ||
              ajp_msg_append_string(msg, s->ssl_cert)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the SSL certificates\n");
              return APR_EGENERAL;
          }
      }
  
      if (s->ssl_cipher) {
          if (ajp_msg_append_uint8(msg, SC_A_SSL_CIPHER) ||
              ajp_msg_append_string(msg, s->ssl_cipher)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the SSL ciphers");
              return APR_EGENERAL;
          }
      }
      if (s->ssl_session) {
          if (ajp_msg_append_uint8(msg, SC_A_SSL_SESSION) ||
              ajp_msg_append_string(msg, s->ssl_session)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the SSL session");
              return APR_EGENERAL;
          }
      }
   */
  
      /*
       * ssl_key_size is required by Servlet 2.3 API
       * added support only in ajp14 mode
       * JFC removed: ae->proto == AJP14_PROTO
       */
   /* XXXX ignored for the moment
      if (s->ssl_key_size != -1) {
          if (ajp_msg_append_uint8(msg, SC_A_SSL_KEY_SIZE) ||
              ajp_msg_append_uint16(msg, (unsigned short) s->ssl_key_size)) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_marshal_into_msgb - "
                     "Error appending the SSL key size");
              return APR_EGENERAL;
          }
      }
   */
  
   /* XXXX ignored for the moment
      if (s->num_attributes > 0) {
          for (i = 0 ; i < s->num_attributes ; i++) {
              if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE)       ||
                  ajp_msg_append_string(msg, s->attributes_names[i]) ||
                  ajp_msg_append_string(msg, s->attributes_values[i])) {
                  ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                        "Error ajp_marshal_into_msgb - "
                        "Error appending attribute %s=%s",
                        s->attributes_names[i], s->attributes_values[i]);
                  return APR_EGENERAL;
              }
          }
      }
    */
  
      if (ajp_msg_append_uint8(msg, SC_A_ARE_DONE)) {
          ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                 "Error ajp_marshal_into_msgb - "
                 "Error appending the message end");
          return APR_EGENERAL;
      }
      
      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
             "ajp_marshal_into_msgb - Done");
      return APR_SUCCESS;
  }
  
  /*
  AJPV13_RESPONSE/AJPV14_RESPONSE:=
      response_prefix (2)
      status          (short)
      status_msg      (short)
      num_headers     (short)
      num_headers*(res_header_name header_value)
      *body_chunk
      terminator      boolean <! -- recycle connection or not  -->
  
  req_header_name := 
      sc_req_header_name | (string)
  
  res_header_name := 
      sc_res_header_name | (string)
  
  header_value :=
      (string)
  
  body_chunk :=
      length  (short)
      body    length*(var binary)
  
   */
  
  
  static apr_status_t ajp_unmarshal_response(ajp_msg_t   *msg,
                                    request_rec  *r)
  {
      apr_uint16_t status;
      apr_status_t rc;
      char *ptr;
      apr_uint16_t  num_headers;
      int i;
  
      rc = ajp_msg_get_uint16(msg,&status);
  
      if (rc != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                 "Error ajp_unmarshal_response - Null status");
          return APR_EGENERAL;
      }
      r->status = status;
  
      rc = ajp_msg_get_string(msg,&ptr);
      if (rc == APR_SUCCESS) {
          r->status_line = apr_pstrdup(r->connection->pool,ptr);
  #if defined(AS400) || defined(_OSD_POSIX)
          ap_xlate_proto_from_ascii(r->status_line, strlen(r->status_line));
  #endif
      } else {
          r->status_line = NULL;
      }
  
      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
             "ajp_unmarshal_response: status = %d", status);
  
      rc = ajp_msg_get_uint16(msg,&num_headers);
      if (rc == APR_SUCCESS) {
          r->headers_out = apr_table_make(r->pool,num_headers);
      } else {
          r->headers_out = NULL;
          num_headers = 0;
      }
  
      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
             "ajp_unmarshal_response: Number of headers is = %d",
             num_headers);
  
      for(i = 0 ; i < (int) num_headers ; i++) {
          apr_uint16_t name;
          char *stringname;
          char *value;
          rc  = ajp_msg_peek_int(msg,&value);
          if (rc != APR_SUCCESS) {
              return APR_EGENERAL;
          }
                  
          if ((name & 0XFF00) == 0XA000) {
              ajp_msg_peek_int(msg,&value);
              name = name & 0X00FF;
              if (name <= SC_RES_HEADERS_NUM) {
                  stringname = (char *)long_res_header_for_sc(name);
              } else {
                  ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                         "Error ajp_unmarshal_response - "
                         "No such sc (%d)",
                         name);
                  return APR_EGENERAL;
              }
          } else {
              rc = ajp_msg_get_string(msg,&stringname);
              if (rc != APR_SUCCESS) {
                  ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                         "Error ajp_unmarshal_response - "
                         "Null header name");
                  return APR_EGENERAL;
              }
  #if defined(AS400) || defined(_OSD_POSIX)
              ap_xlate_proto_from_ascii(stringname, strlen(stringname));
  #endif
          }
  
          rc = ajp_msg_get_string(msg,&value);
          if (rc != APR_SUCCESS) {
              ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                     "Error ajp_unmarshal_response - "
                     "Null header value");
              return APR_EGENERAL;
          }
  
  #if defined(AS400) || defined(_OSD_POSIX)
          ap_xlate_proto_from_ascii(value,strlen(value));
  #endif
          ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                 "ajp_unmarshal_response: Header[%d] [%s] = [%s]\n", 
                         i, name, value);
          ap_table_add(r->headers_out, name, value);
      }
  
      return APR_SUCCESS;
  }
  
  
  
  1.1                  jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.h
  
  Index: ajp_header.h
  ===================================================================
  /*
   * Conditional request attributes
   * 
   */
  #define SC_A_CONTEXT            (unsigned char)1
  #define SC_A_SERVLET_PATH       (unsigned char)2
  #define SC_A_REMOTE_USER        (unsigned char)3
  #define SC_A_AUTH_TYPE          (unsigned char)4
  #define SC_A_QUERY_STRING       (unsigned char)5
  #define SC_A_JVM_ROUTE          (unsigned char)6
  #define SC_A_SSL_CERT           (unsigned char)7
  #define SC_A_SSL_CIPHER         (unsigned char)8
  #define SC_A_SSL_SESSION        (unsigned char)9
  #define SC_A_REQ_ATTRIBUTE      (unsigned char)10
  #define SC_A_SSL_KEY_SIZE       (unsigned char)11       /* only in if JkOptions +ForwardKeySize
*/
  #define SC_A_SECRET             (unsigned char)12
  #define SC_A_ARE_DONE           (unsigned char)0xFF
  
  /*
   * Request methods, coded as numbers instead of strings.
   * The list of methods was taken from Section 5.1.1 of RFC 2616,
   * RFC 2518, the ACL IETF draft, and the DeltaV IESG Proposed Standard.
   *          Method        = "OPTIONS"
   *                        | "GET"    
   *                        | "HEAD"   
   *                        | "POST"   
   *                        | "PUT"    
   *                        | "DELETE" 
   *                        | "TRACE"  
   *                        | "PROPFIND"
   *                        | "PROPPATCH"
   *                        | "MKCOL"
   *                        | "COPY"
   *                        | "MOVE"
   *                        | "LOCK"
   *                        | "UNLOCK"
   *                        | "ACL"
   *                        | "REPORT"
   *                        | "VERSION-CONTROL"
   *                        | "CHECKIN"
   *                        | "CHECKOUT"
   *                        | "UNCHECKOUT"
   *                        | "SEARCH"
   *                        | "MKWORKSPACE"
   *                        | "UPDATE"
   *                        | "LABEL"
   *                        | "MERGE"
   *                        | "BASELINE-CONTROL"
   *                        | "MKACTIVITY"
   * 
   */
  #define SC_M_OPTIONS            (unsigned char)1
  #define SC_M_GET                (unsigned char)2
  #define SC_M_HEAD               (unsigned char)3
  #define SC_M_POST               (unsigned char)4
  #define SC_M_PUT                (unsigned char)5
  #define SC_M_DELETE             (unsigned char)6
  #define SC_M_TRACE              (unsigned char)7
  #define SC_M_PROPFIND           (unsigned char)8
  #define SC_M_PROPPATCH          (unsigned char)9
  #define SC_M_MKCOL              (unsigned char)10
  #define SC_M_COPY               (unsigned char)11
  #define SC_M_MOVE               (unsigned char)12
  #define SC_M_LOCK               (unsigned char)13
  #define SC_M_UNLOCK             (unsigned char)14
  #define SC_M_ACL                (unsigned char)15
  #define SC_M_REPORT             (unsigned char)16
  #define SC_M_VERSION_CONTROL    (unsigned char)17
  #define SC_M_CHECKIN            (unsigned char)18
  #define SC_M_CHECKOUT           (unsigned char)19
  #define SC_M_UNCHECKOUT         (unsigned char)20
  #define SC_M_SEARCH             (unsigned char)21
  #define SC_M_MKWORKSPACE        (unsigned char)22
  #define SC_M_UPDATE             (unsigned char)23
  #define SC_M_LABEL              (unsigned char)24
  #define SC_M_MERGE              (unsigned char)25
  #define SC_M_BASELINE_CONTROL   (unsigned char)26
  #define SC_M_MKACTIVITY         (unsigned char)27
  
  
  /*
   * Frequent request headers, these headers are coded as numbers
   * instead of strings.
   * 
   * Accept
   * Accept-Charset
   * Accept-Encoding
   * Accept-Language
   * Authorization
   * Connection
   * Content-Type
   * Content-Length
   * Cookie
   * Cookie2
   * Host
   * Pragma
   * Referer
   * User-Agent
   * 
   */
  
  #define SC_ACCEPT               (unsigned short)0xA001
  #define SC_ACCEPT_CHARSET       (unsigned short)0xA002
  #define SC_ACCEPT_ENCODING      (unsigned short)0xA003
  #define SC_ACCEPT_LANGUAGE      (unsigned short)0xA004
  #define SC_AUTHORIZATION        (unsigned short)0xA005
  #define SC_CONNECTION           (unsigned short)0xA006
  #define SC_CONTENT_TYPE         (unsigned short)0xA007
  #define SC_CONTENT_LENGTH       (unsigned short)0xA008
  #define SC_COOKIE               (unsigned short)0xA009    
  #define SC_COOKIE2              (unsigned short)0xA00A
  #define SC_HOST                 (unsigned short)0xA00B
  #define SC_PRAGMA               (unsigned short)0xA00C
  #define SC_REFERER              (unsigned short)0xA00D
  #define SC_USER_AGENT           (unsigned short)0xA00E
  
  /*
   * Frequent response headers, these headers are coded as numbers
   * instead of strings.
   * 
   * Content-Type
   * Content-Language
   * Content-Length
   * Date
   * Last-Modified
   * Location
   * Set-Cookie
   * Servlet-Engine
   * Status
   * WWW-Authenticate
   * 
   */
  
  #define SC_RESP_CONTENT_TYPE        (unsigned short)0xA001
  #define SC_RESP_CONTENT_LANGUAGE    (unsigned short)0xA002
  #define SC_RESP_CONTENT_LENGTH      (unsigned short)0xA003
  #define SC_RESP_DATE                (unsigned short)0xA004
  #define SC_RESP_LAST_MODIFIED       (unsigned short)0xA005
  #define SC_RESP_LOCATION            (unsigned short)0xA006
  #define SC_RESP_SET_COOKIE          (unsigned short)0xA007
  #define SC_RESP_SET_COOKIE2         (unsigned short)0xA008
  #define SC_RESP_SERVLET_ENGINE      (unsigned short)0xA009
  #define SC_RESP_STATUS              (unsigned short)0xA00A
  #define SC_RESP_WWW_AUTHENTICATE    (unsigned short)0xA00B
  #define SC_RES_HEADERS_NUM          11
  
  /*
   * Protocol elements
   */
  #define AJP13_FORWARD_REQUEST    (unsigned char)2
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message