httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Fri, 11 Aug 2000 23:45:57 GMT
coar        00/08/11 16:45:57

  Modified:    src/include http_protocol.h
               src/main http_protocol.c
  Log:
  	More prototypical API support for arbitrary extension HTTP methods.
  
  Revision  Changes    Path
  1.22      +9 -0      apache-2.0/src/include/http_protocol.h
  
  Index: http_protocol.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -u -r1.21 -r1.22
  --- http_protocol.h	2000/08/05 19:20:23	1.21
  +++ http_protocol.h	2000/08/11 23:45:56	1.22
  @@ -470,6 +470,15 @@
    */
   API_EXPORT(int) ap_method_number_of(const char *method);
   
  +/**
  + * Get the method name associated with the given internal method
  + * number.  Returns NULL if not recognized.
  + * @param methnum An integer value corresponding to an internal method number
  + * @return The name corresponding to the method number
  + * @deffunc const char *ap_method_name_of(int methnum)
  + */
  +API_EXPORT(const char *) ap_method_name_of(int methnum);
  +
     /* Hooks */
     /*
      * post_read_request --- run right after read_request or internal_redirect,
  
  
  
  1.106     +27 -0     apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -u -r1.105 -r1.106
  --- http_protocol.c	2000/08/11 16:31:40	1.105
  +++ http_protocol.c	2000/08/11 23:45:57	1.106
  @@ -809,6 +809,33 @@
       return M_INVALID;
   }
   
  +API_EXPORT(const char *) ap_method_name_of(int methnum) {
  +    static const char *AP_HTTP_METHODS[] = {
  +	[M_GET]       = "GET",
  +	[M_PUT]       = "PUT",
  +	[M_POST]      = "POST",
  +	[M_DELETE]    = "DELETE",
  +	[M_CONNECT]   = "CONNECT",
  +	[M_OPTIONS]   = "OPTIONS",
  +	[M_TRACE]     = "TRACE",
  +	[M_PATCH]     = "PATCH",
  +	[M_PROPFIND]  = "PROPFIND",
  +	[M_PROPPATCH] = "PROPPATCH",
  +	[M_MKCOL]     = "MKCOL",
  +	[M_COPY]      = "COPY",
  +	[M_MOVE]      = "MOVE",
  +	[M_LOCK]      = "LOCK",
  +	[M_UNLOCK]    = "UNLOCK",
  +	[M_INVALID]   = NULL
  +    };
  +    
  +
  +    if ((methnum == M_INVALID) || (methnum >= METHODS)) {
  +	return NULL;
  +    }
  +    return AP_HTTP_METHODS[methnum];
  +}
  +
   /* Get a line of protocol input, including any continuation lines
    * caused by MIME folding (or broken clients) if fold != 0, and place it
    * in the buffer s, of size n bytes, without the ending newline.
  
  
  

Mime
View raw message