Skip to content

Commit 5f77374

Browse files
committed
fts: dont break server if missing config
1 parent 5513559 commit 5f77374

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/core-net/vhost.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,20 +467,20 @@ lws_protocol_init_vhost(struct lws_vhost *vh, int *any)
467467
) {
468468
lwsl_vhost_info(vh, "init %s.%s", vh->name,
469469
vh->protocols[n].name);
470-
vh->protocol_init |= 1u << n;
471470
if (vh->protocols[n].callback((struct lws *)lwsa,
472-
LWS_CALLBACK_PROTOCOL_INIT, NULL,
473-
(void *)(pvo ? pvo->options : NULL),
474-
0)) {
471+
LWS_CALLBACK_PROTOCOL_INIT, NULL,
472+
(void *)(pvo ? pvo->options : NULL),
473+
0)) {
475474
if (vh->protocol_vh_privs && vh->protocol_vh_privs[n]) {
476475
lws_free(vh->protocol_vh_privs[n]);
477476
vh->protocol_vh_privs[n] = NULL;
478477
}
479-
lwsl_vhost_err(vh, "protocol %s failed init",
478+
lwsl_vhost_warn(vh, "protocol %s failed init",
480479
vh->protocols[n].name);
481480

482-
return 1;
483-
}
481+
// return 1;
482+
} else
483+
vh->protocol_init |= 1u << n;
484484
}
485485
}
486486

lib/roles/http/client/client-http.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,15 +1203,15 @@ lws_client_interpret_server_handshake(struct lws *wsi)
12031203
lwsl_warn("%s: redirect path exceeds ah size\n", __func__);
12041204
goto bail3;
12051205
}
1206-
memcpy(wsi->http.ah->data + wsi->http.ah->pos + 1, path, pl + 1);
1206+
memcpy(wsi->http.ah->data + wsi->http.ah->pos + 1, path, pl + 1u);
12071207
wsi->http.ah->data[wsi->http.ah->pos] = '/';
12081208
wsi->http.ah->frags[wsi->http.ah->frag_index[_WSI_TOKEN_CLIENT_URI]].offset = wsi->http.ah->pos;
1209-
wsi->http.ah->frags[wsi->http.ah->frag_index[_WSI_TOKEN_CLIENT_URI]].len = pl + 1;
1209+
wsi->http.ah->frags[wsi->http.ah->frag_index[_WSI_TOKEN_CLIENT_URI]].len = (uint16_t)(pl + 1u);
12101210

12111211
if (wsi->stash)
12121212
wsi->stash->cis[CIS_PATH] = wsi->http.ah->data + wsi->http.ah->pos;
12131213

1214-
wsi->http.ah->pos += pl + 1;
1214+
wsi->http.ah->pos += pl + 1u;
12151215
}
12161216

12171217

plugins/protocol_fulltext_demo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ callback_fts(struct lws *wsi, enum lws_callback_reasons reason, void *user,
8181
return 0;
8282
if (lws_pvo_get_str(in, "indexpath",
8383
(const char **)&vhd->indexpath))
84-
return 1;
84+
return 0;
8585

8686
return 0;
8787

0 commit comments

Comments
 (0)