Преглед изворни кода

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

bel2125 пре 8 година
родитељ
комит
c4e5e9d2d4
2 измењених фајлова са 3 додато и 3 уклоњено
  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