Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/datasync/datasync.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "listen/listen_registry.h"

#define WEBCOM_PROTOCOL_VERSION "5"
#define WEBCOM_WS_PATH "/_wss/.ws"
#define WEBCOM_WS_PATH "/datasync/v2"

static int _wc_datasync_process_message(wc_context_t *ctx, wc_msg_t *msg) {
struct wc_timerargs ta;
Expand Down Expand Up @@ -286,16 +286,17 @@ wc_datasync_context_t *wc_datasync_init(wc_context_t *ctx) {
ctx->datasync.lws_cci.ssl_connection = !ctx->no_tls;
ws_path_l = (
sizeof(WEBCOM_WS_PATH) - 1
+ 3
+ 1
+ strlen(ctx->app_name)
+ 6
+ sizeof(WEBCOM_PROTOCOL_VERSION) - 1
+ 4
+ strlen(ctx->app_name)
+ 1 );
ctx->datasync.lws_cci.path = malloc(ws_path_l);
if (ctx->datasync.lws_cci.path == NULL) {
return NULL;
}
snprintf((char*)ctx->datasync.lws_cci.path, ws_path_l, "%s?v=%s&ns=%s", WEBCOM_WS_PATH, WEBCOM_PROTOCOL_VERSION, ctx->app_name);
snprintf((char*)ctx->datasync.lws_cci.path, ws_path_l, "%s/%s/ws?v=%s", WEBCOM_WS_PATH, ctx->app_name, WEBCOM_PROTOCOL_VERSION);
//snprintf((char*)ctx->datasync.lws_cci.path, ws_path_l, "%s?v=%s&ns=%s", WEBCOM_WS_PATH, WEBCOM_PROTOCOL_VERSION, ctx->app_name);
ctx->datasync.lws_cci.protocol = protocols[0].name;
ctx->datasync.lws_cci.ietf_version_or_minus_one = -1;
ctx->datasync.lws_cci.userdata = (void *)ctx;
Expand Down