mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ss: windows build adaptations
Windows compiler finds various non-bug things to complain about when building with SS and other options, fix them up
This commit is contained in:
parent
33c9a6da4c
commit
2d55e18947
7 changed files with 31 additions and 12 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue