mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Resetting endpoint_type in open_local_endpoint()
This commit is contained in:
parent
18e28ef879
commit
a7a17711ec
10
mongoose.c
10
mongoose.c
@ -729,7 +729,8 @@ static void ns_write_to_socket(struct ns_connection *conn) {
|
||||
ns_hexdump(conn, io->buf, n, "->");
|
||||
#endif
|
||||
|
||||
DBG(("%p -> %d bytes [%.*s%s]", conn, n, io->len < 40 ? io->len : 40,
|
||||
DBG(("%p -> %d bytes %d [%.*s%s]", conn, n, conn->flags,
|
||||
io->len < 40 ? io->len : 40,
|
||||
io->buf, io->len < 40 ? "" : "..."));
|
||||
|
||||
if (ns_is_error(n)) {
|
||||
@ -3925,7 +3926,7 @@ static void lsp(struct connection *conn, const char *p, int len, lua_State *L) {
|
||||
|
||||
static void handle_lsp_request(struct connection *conn, const char *path,
|
||||
file_stat_t *st) {
|
||||
void *p = NULL;
|
||||
void *p = MAP_FAILED;
|
||||
lua_State *L = NULL;
|
||||
FILE *fp = NULL;
|
||||
|
||||
@ -3946,7 +3947,7 @@ static void handle_lsp_request(struct connection *conn, const char *path,
|
||||
}
|
||||
|
||||
if (L != NULL) lua_close(L);
|
||||
if (p != NULL) munmap(p, st->st_size);
|
||||
if (p != MAP_FAILED) munmap(p, st->st_size);
|
||||
if (fp != NULL) fclose(fp);
|
||||
}
|
||||
#endif // MONGOOSE_USE_LUA
|
||||
@ -4125,6 +4126,9 @@ static void open_local_endpoint(struct connection *conn, int skip_user) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If EP_USER was set in a prev call, reset it
|
||||
conn->endpoint_type = EP_NONE;
|
||||
|
||||
#ifndef MONGOOSE_NO_AUTH
|
||||
if (conn->server->event_handler && call_user(conn, MG_AUTH) == MG_FALSE) {
|
||||
mg_send_digest_auth_request(&conn->mg_conn);
|
||||
|
Loading…
Reference in New Issue
Block a user