httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/dav/main mod_dav.c
Date Tue, 04 Jul 2000 00:28:32 GMT
gstein      00/07/03 17:28:29

  Modified:    src/include http_protocol.h
               src/main http_protocol.c
               src/modules/dav/main mod_dav.c
  Log:
  add ap_get_status_line() so that modules can get a standardized
      Status-Line value for their response.
  
  Submitted by: Joe Orton <joe@orton.demon.co.uk>
  Reviewed by: Greg Stein
  
  Revision  Changes    Path
  1.17      +7 -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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- http_protocol.h	2000/06/24 17:33:53	1.16
  +++ http_protocol.h	2000/07/04 00:28:04	1.17
  @@ -165,6 +165,13 @@
   
   API_EXPORT(int) ap_index_of_response(int status);
   
  +/* 
  + * Return the Status-Line for a given status code (excluding the
  + * HTTP-Version field). If an invalid or unknown status code is
  + * passed, "500 Internal Server Error" will be returned. 
  + */
  +API_EXPORT(const char *) ap_get_status_line(int status);
  +
   /* Reading a block of data from the client connection (e.g., POST arg) */
   
   API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy);
  
  
  
  1.90      +5 -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.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- http_protocol.c	2000/06/28 14:33:32	1.89
  +++ http_protocol.c	2000/07/04 00:28:23	1.90
  @@ -1466,6 +1466,11 @@
       return LEVEL_500;           /* 600 or above is also illegal */
   }
   
  +API_EXPORT(const char *) ap_get_status_line(int status)
  +{
  +    return status_lines[ap_index_of_response(status)];
  +}
  +
   /* Send a single HTTP header field to the client.  Note that this function
    * is used in calls to table_do(), so their interfaces are co-dependent.
    * In other words, don't change this one without checking table_do in alloc.c.
  
  
  
  1.7       +5 -3      apache-2.0/src/modules/dav/main/mod_dav.c
  
  Index: mod_dav.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/main/mod_dav.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_dav.c	2000/07/03 22:50:58	1.6
  +++ mod_dav.c	2000/07/04 00:28:25	1.7
  @@ -595,10 +595,12 @@
   	ap_rputs("</D:href>" DEBUG_CR, r);
   
   	if (first->propresult.propstats == NULL) {
  -	    /* ### it would be nice to get a status line from Apache */
  +	    /* use the Status-Line text from Apache.  Note, this will
  +	     * default to 500 Internal Server Error if first->status
  +	     * is not a known (or valid) status code. */
   	    ap_rprintf(r,
  -		       "<D:status>HTTP/1.1 %d status text goes here</D:status>"
  -		       DEBUG_CR, first->status);
  +		       "<D:status>HTTP/1.1 %s</D:status>" DEBUG_CR, 
  +		       ap_get_status_line(first->status));
   	}
   	else {
   	    /* assume this includes <propstat> and is quoted properly */
  
  
  

Mime
View raw message