Browse Source

Test mg_set_user_connection_data with const param (see #452)

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

+ 2 - 1
include/civetweb.h

@@ -72,6 +72,7 @@ CIVETWEB_API unsigned mg_exit_library(void);
 
 
 struct mg_context;    /* Handle for the HTTP service itself */
+
 struct mg_connection; /* Handle for the individual connection */
 
 
@@ -497,7 +498,7 @@ CIVETWEB_API void *mg_get_user_data(const struct mg_context *ctx);
 
 
 /* Set user data for the current connection. */
-CIVETWEB_API void mg_set_user_connection_data(struct mg_connection *conn,
+CIVETWEB_API void mg_set_user_connection_data(const struct mg_connection *conn,
                                               void *data);
 
 

+ 2 - 1
src/civetweb.c

@@ -2936,8 +2936,9 @@ mg_get_user_data(const struct mg_context *ctx)
 
 
 void
-mg_set_user_connection_data(struct mg_connection *conn, void *data)
+mg_set_user_connection_data(const struct mg_connection *cconn, void *data)
 {
+    struct mg_connection *conn = (struct mg_connection *)cconn;
 	if (conn != NULL) {
 		conn->request_info.conn_data = data;
 	}