diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h index 1d36923b0..493218c10 100644 --- a/include/libwebsockets/lws-misc.h +++ b/include/libwebsockets/lws-misc.h @@ -723,6 +723,10 @@ lws_vbi_decode(const void *buf, uint64_t *value, size_t len); /* opaque internal struct */ struct lws_spawn_piped; +#if defined(WIN32) +typedef struct _lws_siginfo_t *siginfo_t; +#endif + typedef void (*lsp_cb_t)(void *opaque, lws_usec_t *accounting, siginfo_t *si, int we_killed_him); diff --git a/lib/misc/lws-struct-lejp.c b/lib/misc/lws-struct-lejp.c index 477bd55e9..627a891fa 100644 --- a/lib/misc/lws-struct-lejp.c +++ b/lib/misc/lws-struct-lejp.c @@ -675,7 +675,7 @@ lws_struct_json_serialize(lws_struct_serialize_t *js, uint8_t *buf, * in "used". */ - lws_json_purify((char *)buf, q, len, &used); + lws_json_purify((char *)buf, q, (int)len, &used); m = strlen((const char *)buf); buf += m; len -= m; diff --git a/lib/secure-streams/policy-common.c b/lib/secure-streams/policy-common.c index 98102dfc3..24fe833b8 100644 --- a/lib/secure-streams/policy-common.c +++ b/lib/secure-streams/policy-common.c @@ -202,7 +202,8 @@ lws_ss_policy_set(struct lws_context *context, const char *name) i.vhost_name = pol->trust_store->name; lwsl_debug("%s: %s\n", __func__, i.vhost_name); i.client_ssl_ca_mem = pol->trust_store->ssx509[0]->ca_der; - i.client_ssl_ca_mem_len = pol->trust_store->ssx509[0]->ca_der_len; + i.client_ssl_ca_mem_len = (unsigned int) + pol->trust_store->ssx509[0]->ca_der_len; i.port = CONTEXT_PORT_NO_LISTEN; lwsl_info("%s: %s trust store initial '%s'\n", __func__, i.vhost_name, pol->trust_store->ssx509[0]->vhost_name); diff --git a/lib/secure-streams/policy-json.c b/lib/secure-streams/policy-json.c index 49eb0e5ed..51c05f1a8 100644 --- a/lib/secure-streams/policy-json.c +++ b/lib/secure-streams/policy-json.c @@ -365,7 +365,7 @@ lws_ss_policy_parser_cb(struct lejp_ctx *ctx, char reason) lws_b64_decode_stateful(&a->b64, ctx->buf, &inl, a->p + a->count, &outl, reason == LEJPCB_VAL_STR_END); - a->count += outl; + a->count += (int)outl; if (inl != ctx->npos) { lwsl_err("%s: b64 decode fail\n", __func__); goto oom; @@ -766,7 +766,7 @@ lws_ss_policy_parse(struct lws_context *context, const uint8_t *buf, size_t len) struct policy_cb_args *args = (struct policy_cb_args *)context->pol_args; int m; - m = (int)(signed char)lejp_parse(&args->jctx, buf, len); + m = (int)(signed char)lejp_parse(&args->jctx, buf, (int)len); if (m == LEJP_CONTINUE || m >= 0) return m; diff --git a/lib/secure-streams/private-lib-secure-streams.h b/lib/secure-streams/private-lib-secure-streams.h index 514307f7f..02e607f65 100644 --- a/lib/secure-streams/private-lib-secure-streams.h +++ b/lib/secure-streams/private-lib-secure-streams.h @@ -92,10 +92,19 @@ typedef struct lws_ss_handle { union { struct { /* LWSSSP_H1 */ +#if defined(WIN32) + uint8_t dummy; +#endif } h1; struct { /* LWSSSP_H2 */ +#if defined(WIN32) + uint8_t dummy; +#endif } h2; struct { /* LWSSSP_WS */ +#if defined(WIN32) + uint8_t dummy; +#endif } ws; } u; } http; @@ -132,6 +141,10 @@ typedef struct lws_ss_handle { union lws_ss_contemp { #if defined(LWS_ROLE_MQTT) lws_mqtt_client_connect_param_t ccp; +#else +#if defined(WIN32) + uint8_t dummy; +#endif #endif }; @@ -363,9 +376,9 @@ struct ss_pcols { const char *name; const char *alpn; const char *protocol_name; - const secstream_protocol_connect_munge_t munge; - const secstream_protocol_add_txcr_t tx_cr_add; - const secstream_protocol_get_txcr_t tx_cr_est; + secstream_protocol_connect_munge_t munge; + secstream_protocol_add_txcr_t tx_cr_add; + secstream_protocol_get_txcr_t tx_cr_est; }; extern const struct ss_pcols ss_pcol_h1; diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index 81065a334..2daf8747f 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -272,7 +272,8 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user, lws_strnncpy(h->u.http.boundary + 4, ts.token, ts.token_len, sizeof(h->u.http.boundary) - 4); - h->u.http.boundary_len = ts.token_len + 4; + h->u.http.boundary_len = + (uint8_t)(ts.token_len + 4); h->u.http.boundary_seq = 2; h->u.http.boundary_dashes = 0; } @@ -334,7 +335,7 @@ malformed: if (lws_add_http_header_by_name(wsi, (uint8_t *)h->policy->u.http.blob_header[m], - buf, buflen + o, p, end)) + buf, (int)(buflen + o), p, end)) return -1; } @@ -357,7 +358,7 @@ malformed: if (lws_add_http_header_by_name(wsi, polmd->value, h->metadata[m].value, - h->metadata[m].length, p, end)) + (int)h->metadata[m].length, p, end)) return -1; } } diff --git a/lib/secure-streams/system/auth-api.amazon.com/auth.c b/lib/secure-streams/system/auth-api.amazon.com/auth.c index 697ae77b4..7e3d6d4e1 100644 --- a/lib/secure-streams/system/auth-api.amazon.com/auth.c +++ b/lib/secure-streams/system/auth-api.amazon.com/auth.c @@ -126,7 +126,7 @@ ss_api_amazon_auth_rx(void *userobj, const uint8_t *buf, size_t len, int flags) lws_system_blob_heap_empty(ab); } - n = (int)(signed char)lejp_parse(&m->jctx, buf, len); + n = (int)(signed char)lejp_parse(&m->jctx, buf, (int)len); if (n < 0) { lejp_destruct(&m->jctx); lws_system_blob_destroy( @@ -205,7 +205,7 @@ ss_api_amazon_auth_state(void *userobj, void *sh, lws_ss_constate_t state, s = lws_system_blob_get_size( lws_system_get_blob(context, LWS_SYSBLOB_TYPE_AUTH, AUTH_IDX_ROOT)); - lws_ss_request_tx_len(m->ss, s); + lws_ss_request_tx_len(m->ss, (unsigned long)s); m->pos = 0; break;