Browse Source

Add const to mg_connection, for mg_get_response_code_text function, since it is not reading or writing data

bel2125 8 years ago
parent
commit
c4e5e9d2d4
2 changed files with 3 additions and 3 deletions
  1. 2 2
      include/civetweb.h
  2. 1 1
      src/civetweb.c

+ 2 - 2
include/civetweb.h

@@ -981,8 +981,8 @@ CIVETWEB_API const char *mg_get_builtin_mime_type(const char *file_name);
 
 
 /* Get text representation of HTTP status code. */
-CIVETWEB_API const char *mg_get_response_code_text(struct mg_connection *conn,
-                                                   int response_code);
+CIVETWEB_API const char *
+mg_get_response_code_text(const struct mg_connection *conn, int response_code);
 
 
 /* Return CivetWeb version. */

+ 1 - 1
src/civetweb.c

@@ -3299,7 +3299,7 @@ static void handle_file_based_request(struct mg_connection *conn,
 
 
 const char *
-mg_get_response_code_text(struct mg_connection *conn, int response_code)
+mg_get_response_code_text(const struct mg_connection *conn, int response_code)
 {
 	/* See IANA HTTP status code assignment:
 	 * http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml