Skip to content

Commit a831f9e

Browse files
committed
fixes
1 parent 3575250 commit a831f9e

7 files changed

Lines changed: 19 additions & 9 deletions

File tree

include/libwebsockets/lws-system.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ typedef enum {
182182
LWS_CPD_NO_INTERNET, /* we couldn't touch anything */
183183
} lws_cpd_result_t;
184184

185+
#if defined(LWS_WITH_NETWORK)
185186
typedef enum {
186187
LWS_EXTIP_SRC_DHT,
187188
LWS_EXTIP_SRC_EXTIP
188189
} lws_extip_src_t;
190+
#endif
189191

190192
typedef void (*lws_attach_cb_t)(struct lws_context *context, int tsi, void *opaque);
191193
struct lws_attach_item;
@@ -269,6 +271,7 @@ typedef struct lws_system_ops {
269271
#endif
270272
} lws_system_ops_t;
271273

274+
#if defined(LWS_WITH_NETWORK)
272275
/**
273276
* lws_extip_report() - update external IP tracking state from callback
274277
*
@@ -298,6 +301,7 @@ lws_extip_report(struct lws_context *cx, lws_extip_src_t src, const lws_sockaddr
298301
*/
299302
LWS_VISIBLE LWS_EXTERN int
300303
lws_extip_get_best(struct lws_context *cx, int af, lws_sockaddr46 *sa46);
304+
#endif
301305

302306
#if defined(LWS_WITH_SYS_STATE)
303307

lib/plat/unix/unix-spawn.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)
466466
if (slave >= 0) {
467467
struct termios t;
468468
tcgetattr(slave, &t);
469-
cfmakeraw(&t);
469+
t.c_iflag &= (tcflag_t)~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
470+
t.c_oflag &= (tcflag_t)~OPOST;
471+
t.c_lflag &= (tcflag_t)~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
472+
t.c_cflag &= (tcflag_t)~(CSIZE | PARENB);
473+
t.c_cflag |= CS8;
470474
tcsetattr(slave, TCSANOW, &t);
471475
lsp->pipe_fds[n][0] = master;
472476
lsp->pipe_fds[n][1] = slave;

lib/roles/http/server/lejp-conf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,6 @@ lwsws_get_config_vhosts(struct lws_context *context,
13291329
if (!vh)
13301330
return 1;
13311331

1332-
extern int lws_context_init_ssl_library(struct lws_context *cx, const struct lws_context_creation_info *info);
13331332
lws_context_init_ssl_library(context, &i);
13341333
lws_init_vhost_client_ssl(&i, vh);
13351334

lib/system/system.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ lws_system_do_attach(struct lws_context_per_thread *pt)
262262
return 0;
263263
}
264264

265-
#endif
266-
267265
void
268266
lws_extip_report(struct lws_context *cx, lws_extip_src_t src,
269267
const lws_sockaddr46 *sa46, int af, int status,
@@ -287,7 +285,9 @@ lws_extip_report(struct lws_context *cx, lws_extip_src_t src,
287285
}
288286

289287
if (memcmp(&old, target, sizeof(*target))) {
288+
#if defined(LWS_WITH_IPV6)
290289
int c = 0;
290+
#endif
291291
char payload[128], buf4[64];
292292
char *p = payload, *end = payload + sizeof(payload);
293293

@@ -296,7 +296,9 @@ lws_extip_report(struct lws_context *cx, lws_extip_src_t src,
296296
if (cx->ext_ipv4.sa4.sin_family == AF_INET) {
297297
lws_sa46_write_numeric_address(&cx->ext_ipv4, buf4, sizeof(buf4));
298298
p += lws_snprintf(p, lws_ptr_diff_size_t(end, p), "\"%s\"", buf4);
299+
#if defined(LWS_WITH_IPV6)
299300
c++;
301+
#endif
300302
}
301303

302304
#if defined(LWS_WITH_IPV6)
@@ -340,3 +342,5 @@ lws_extip_get_best(struct lws_context *cx, int af, lws_sockaddr46 *sa46)
340342
memset(sa46, 0, sizeof(*sa46));
341343
return 1;
342344
}
345+
346+
#endif

minimal-examples-lowlevel/api-tests/api-test-x509/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int argc, const char **argv)
4343
return 1;
4444
}
4545

46-
if (lws_x509_parse_from_pem(x509, test_cert, strlen(test_cert))) {
46+
if (lws_x509_parse_from_pem(x509, test_cert, strlen(test_cert) + 1)) {
4747
lwsl_err("lws_x509_parse_from_pem failed\n");
4848
ret = 1;
4949
goto bail;

minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/protocol_lws_minimal_dbus_ws_proxy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,13 @@ static DBusHandlerResult
217217
dmh_connect(DBusConnection *c, DBusMessage *m, DBusMessage **reply, void *d)
218218
{
219219
struct lws_dbus_ctx_wsproxy *wspctx = (struct lws_dbus_ctx_wsproxy *)d;
220-
const char *prot = "", *ads = "", *path = "", *baduri = "Bad Uri",
220+
const char *prot = "", *baduri = "Bad Uri",
221221
*connecting = "Connecting", *failed = "Failed", **pp;
222222
struct lws_client_connect_info i;
223223
char host[128];
224224
const char *uri, *subprotocol;
225225
lws_parse_uri_t *puri = NULL;
226226
DBusError err;
227-
int port = 0;
228227

229228
dbus_error_init(&err);
230229

plugins/protocol_lws_dht_dnssec_monitor/protocol_lws_dht_dnssec_monitor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ whois_cb(void *opaque, const struct lws_whois_results *res)
224224
now, now + 300);
225225

226226
if (lws_jwt_sign_compact(wqi->vhd->context, &wqi->vhd->auth_jwk, "HS256",
227-
jwt, &jwt_len, temp, sizeof(temp), jwt_payload)) {
227+
jwt, &jwt_len, temp, sizeof(temp), "%s", jwt_payload)) {
228228
lwsl_err("[INSTRUMENT] %s: failed to generate jwt for whois\n", __func__);
229229
}
230230
}
@@ -350,7 +350,7 @@ calc_local_ds(struct vhd *vhd, const char *domain, char *out, size_t out_len)
350350
memcpy(p, rdata, rdata_len);
351351
size_t pay_len = (size_t)lws_ptr_diff(p + rdata_len, payload);
352352

353-
int htype = LWS_GENHASH_TYPE_SHA256;
353+
enum lws_genhash_types htype = LWS_GENHASH_TYPE_SHA256;
354354
int dtype = 2;
355355
int dlen = 32;
356356
if (alg == 14) {

0 commit comments

Comments
 (0)