mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-18 19:31:02 +00:00
Changing API: callback doesnt get mg_request_info pointer anymore, but it is possible to get it using mg_get_request_info()
This commit is contained in:
1 parent
e8f3132aa8
commit
0e0091e1c0
6 files changed
+24
-17
No files matched your search
+6
-3
@@ -492,7 +492,7 @@ const char **mg_get_valid_option_names(void) {
|
||||
static void *call_user(struct mg_connection *conn, enum mg_event event) {
|
||||
conn->request_info.user_data = conn->ctx->user_data;
|
||||
return conn->ctx->user_callback == NULL ? NULL :
|
||||
conn->ctx->user_callback(event, conn, &conn->request_info);
|
||||
conn->ctx->user_callback(event, conn);
|
||||
}
|
||||
|
||||
static int get_option_index(const char *name) {
|
||||
@@ -588,6 +588,10 @@ const char *mg_version(void) {
|
||||
return MONGOOSE_VERSION;
|
||||
}
|
||||
|
||||
const struct mg_request_info *mg_get_request_info(struct mg_connection *conn) {
|
||||
return &conn->request_info;
|
||||
}
|
||||
|
||||
static void mg_strlcpy(register char *dst, register const char *src, size_t n) {
|
||||
for (; *src != '\0' && n > 1; n--) {
|
||||
*dst++ = *src++;
|
||||
@@ -3758,8 +3762,7 @@ static int set_ssl_option(struct mg_context *ctx) {
|
||||
} else if (ctx->user_callback != NULL) {
|
||||
memset(&request_info, 0, sizeof(request_info));
|
||||
request_info.user_data = ctx->user_data;
|
||||
ctx->user_callback(MG_INIT_SSL, (struct mg_connection *) ctx->ssl_ctx,
|
||||
&request_info);
|
||||
ctx->user_callback(MG_INIT_SSL, (struct mg_connection *) ctx->ssl_ctx);
|
||||
}
|
||||
|
||||
if (ctx->ssl_ctx != NULL && pem != NULL &&
|
||||
|
||||
Reference in new issue
Block a user