mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-01 11:07:46 +08:00
Using MAP_PRIVATE for mmap, to fix mac build for Lua
This commit is contained in:
parent
451d077170
commit
5c9ab40601
@ -3969,7 +3969,7 @@ static void handle_lsp_request(struct mg_connection *conn, const char *path,
|
|||||||
|
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
send_http_error(conn, 404, "Not Found", "%s", "File not found");
|
send_http_error(conn, 404, "Not Found", "%s", "File not found");
|
||||||
} else if ((p = mmap(NULL, st->size, PROT_READ, 0,
|
} else if ((p = mmap(NULL, st->size, PROT_READ, MAP_PRIVATE,
|
||||||
fileno(fp), 0)) == MAP_FAILED) {
|
fileno(fp), 0)) == MAP_FAILED) {
|
||||||
send_http_error(conn, 500, http_500_error, "%s", "x");
|
send_http_error(conn, 500, http_500_error, "%s", "x");
|
||||||
} else if ((L = luaL_newstate()) == NULL) {
|
} else if ((L = luaL_newstate()) == NULL) {
|
||||||
@ -4343,7 +4343,7 @@ static int load_dll(struct mg_context *ctx, const char *dll_name,
|
|||||||
static int set_ssl_option(struct mg_context *ctx) {
|
static int set_ssl_option(struct mg_context *ctx) {
|
||||||
int i, size;
|
int i, size;
|
||||||
const char *pem;
|
const char *pem;
|
||||||
|
|
||||||
// If PEM file is not specified, skip SSL initialization.
|
// If PEM file is not specified, skip SSL initialization.
|
||||||
if ((pem = ctx->config[SSL_CERTIFICATE]) == NULL) {
|
if ((pem = ctx->config[SSL_CERTIFICATE]) == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
@ -4368,7 +4368,7 @@ static int set_ssl_option(struct mg_context *ctx) {
|
|||||||
cry(fc(ctx), "SSL_CTX_new (server) error: %s", ssl_error());
|
cry(fc(ctx), "SSL_CTX_new (server) error: %s", ssl_error());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If user callback returned non-NULL, that means that user callback has
|
// If user callback returned non-NULL, that means that user callback has
|
||||||
// set up certificate itself. In this case, skip sertificate setting.
|
// set up certificate itself. In this case, skip sertificate setting.
|
||||||
if (call_user(fc(ctx), MG_INIT_SSL) == NULL &&
|
if (call_user(fc(ctx), MG_INIT_SSL) == NULL &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user