浏览代码

Mark mg_set_user_connection_data as deprecated (see #452)

bel2125 7 年之前
父节点
当前提交
ea7117a819
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      include/civetweb.h

+ 8 - 0
include/civetweb.h

@@ -596,6 +596,14 @@ CIVETWEB_API void *mg_get_user_data(const struct mg_context *ctx);
 
 
 /* Set user data for the current connection. */
+/* Note: This function is deprecated. Use the init_connection callback
+   instead to initialize the user connection data pointer. It is
+   reccomended to supply a pointer to some user defined data structure
+   as conn_data initializer in init_connection. In case it is required
+   to change some data after the init_connection call, store another
+   data pointer in the user defined data structure and modify that
+   pointer. In either case, after the init_connection callback, only
+   calls to mg_get_user_connection_data should be required. */
 CIVETWEB_API void mg_set_user_connection_data(struct mg_connection *conn,
                                               void *data);