Lines Matching +full:continue +full:- +full:on +full:- +full:error
2 * libwebsockets - small server side websockets and web server implementation
4 * Copyright (C) 2010 - 2021 Andy Green <andy@warmcat.com>
29 #include "private-lib-core.h"
48 /* the fact we checked implies we avoided back-to-back writes */ in lws_send_pipe_choked()
49 wsi_eff->could_have_pending = 0; in lws_send_pipe_choked()
54 ||wsi->http.comp_ctx.buflist_comp || in lws_send_pipe_choked()
55 wsi->http.comp_ctx.may_have_more in lws_send_pipe_choked()
60 return (int)wsi_eff->sock_send_blocking; in lws_send_pipe_choked()
69 assert((fd->events & LWS_POLLIN) == LWS_POLLIN); in lws_poll_listen_fd()
72 FD_SET(fd->fd, &readfds); in lws_poll_listen_fd()
74 return select(((int)fd->fd) + 1, &readfds, NULL, NULL, &tv); in lws_poll_listen_fd()
84 int error = LWS_ERRNO; in lws_plat_set_nonblocking() local
85 lwsl_err("ioctlsocket FIONBIO 1 failed with error %d\n", error); in lws_plat_set_nonblocking()
103 if (vhost->ka_time) { in lws_plat_set_socket_options()
104 /* enable keepalive on this socket */ in lws_plat_set_socket_options()
108 int error = LWS_ERRNO; in lws_plat_set_socket_options() local
109 lwsl_err("setsockopt SO_KEEPALIVE 1 failed with error %d\n", error); in lws_plat_set_socket_options()
114 alive.keepalivetime = vhost->ka_time * 1000; in lws_plat_set_socket_options()
115 alive.keepaliveinterval = vhost->ka_interval * 1000; in lws_plat_set_socket_options()
119 int error = LWS_ERRNO; in lws_plat_set_socket_options() local
120 …tl SIO_KEEPALIVE_VALS 1 %lu %lu failed with error %d\n", alive.keepalivetime, alive.keepaliveinter… in lws_plat_set_socket_options()
130 int error = LWS_ERRNO; in lws_plat_set_socket_options() local
131 lwsl_warn("getprotobyname(\"TCP\") failed with error, falling back to 6 %d\n", error); in lws_plat_set_socket_options()
134 protonbr = tcp_proto->p_proto; in lws_plat_set_socket_options()
140 int error = LWS_ERRNO; in lws_plat_set_socket_options() local
141 lwsl_warn("setsockopt TCP_NODELAY 1 failed with error %d\n", error); in lws_plat_set_socket_options()
153 * https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options in lws_plat_set_socket_options_ip()
154 * https://docs.microsoft.com/en-us/previous-versions/windows/desktop/qos/differentiated-services in lws_plat_set_socket_options_ip()
156 lwsl_warn("%s: not implemented on windows platform\n", __func__); in lws_plat_set_socket_options_ip()
170 if (lws_plat_inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1) { in lws_interface_to_sa()
181 address = ((struct in_addr *)entry->h_addr_list[0])->s_addr; in lws_interface_to_sa()
187 addr->sin_addr.s_addr = (unsigned long)(lws_intptr_t)address; in lws_interface_to_sa()
195 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; in lws_plat_insert_socket_into_fds()
198 if (wsi->udp) { in lws_plat_insert_socket_into_fds()
200 pt->fds[pt->fds_count].events |= LWS_POLLIN; in lws_plat_insert_socket_into_fds()
204 if (context->event_loop_ops->io) in lws_plat_insert_socket_into_fds()
205 context->event_loop_ops->io(wsi, LWS_EV_START | LWS_EV_READ); in lws_plat_insert_socket_into_fds()
207 pt->fds[pt->fds_count++].revents = 0; in lws_plat_insert_socket_into_fds()
209 lws_plat_change_pollfd(context, wsi, &pt->fds[pt->fds_count - 1]); in lws_plat_insert_socket_into_fds()
216 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; in lws_plat_delete_socket_from_fds()
218 pt->fds_count--; in lws_plat_delete_socket_from_fds()
228 if (getsockopt(wsi->desc.sockfd, SOL_SOCKET, SO_ERROR, in lws_plat_check_connection_error()
243 //struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; in lws_plat_change_pollfd()
261 if (lws_check_opt(vhost->options, in lws_plat_vhost_tls_client_ctx_init()
270 store = SSL_CTX_get_cert_store(vhost->tls.ssl_client_ctx); in lws_plat_vhost_tls_client_ctx_init()
296 ecert = (const unsigned char*)pcc->pbCertEncoded; in lws_plat_vhost_tls_client_ctx_init()
298 continue; in lws_plat_vhost_tls_client_ctx_init()
301 if (CompareFileTime(&pcc->pCertInfo->NotBefore, &ft) > 0 || in lws_plat_vhost_tls_client_ctx_init()
302 CompareFileTime(&ft, &pcc->pCertInfo->NotAfter) > 0) in lws_plat_vhost_tls_client_ctx_init()
303 continue; in lws_plat_vhost_tls_client_ctx_init()
306 if (CertGetIntendedKeyUsage(pcc->dwCertEncodingType, in lws_plat_vhost_tls_client_ctx_init()
307 pcc->pCertInfo, in lws_plat_vhost_tls_client_ctx_init()
310 continue; in lws_plat_vhost_tls_client_ctx_init()
313 continue; in lws_plat_vhost_tls_client_ctx_init()
321 * The call below checks both, and behavior varies depending on in lws_plat_vhost_tls_client_ctx_init()
326 continue; in lws_plat_vhost_tls_client_ctx_init()
341 continue; in lws_plat_vhost_tls_client_ctx_init()
343 if (!ceu || (ceu && !ceu->cUsageIdentifier)) { in lws_plat_vhost_tls_client_ctx_init()
350 continue; in lws_plat_vhost_tls_client_ctx_init()
364 for (i = 0; i < ceu->cUsageIdentifier; i++) { in lws_plat_vhost_tls_client_ctx_init()
367 ceu->rgpszUsageIdentifier[i])) in lws_plat_vhost_tls_client_ctx_init()
368 continue; in lws_plat_vhost_tls_client_ctx_init()
376 continue; in lws_plat_vhost_tls_client_ctx_init()
379 x509 = d2i_X509(NULL, &ecert, pcc->cbCertEncoded); in lws_plat_vhost_tls_client_ctx_init()
382 continue; in lws_plat_vhost_tls_client_ctx_init()
470 return -1; in lws_plat_inet_pton()
477 return -1; in lws_plat_inet_pton()
513 return ok ? 1 : -1; in lws_plat_inet_pton()
519 lwsl_err("%s: UNIMPLEMENTED on this platform\n", __func__); in lws_plat_ifname_to_hwaddr()
521 return -1; in lws_plat_ifname_to_hwaddr()
528 lwsl_err("%s: UNIMPLEMENTED on this platform\n", __func__); in lws_plat_rawudp_broadcast()
530 return -1; in lws_plat_rawudp_broadcast()
536 lwsl_err("%s: UNIMPLEMENTED on this platform\n", __func__); in lws_plat_if_up()
538 return -1; in lws_plat_if_up()
544 lwsl_err("%s: UNIMPLEMENTED on this platform\n", __func__); in lws_plat_BINDTODEVICE()
546 return -1; in lws_plat_BINDTODEVICE()
552 lwsl_err("%s: UNIMPLEMENTED on this platform\n", __func__); in lws_plat_ifconfig()
554 return -1; in lws_plat_ifconfig()
561 int fd = ((mbedtls_net_context *) ctx)->fd; in lws_plat_mbedtls_net_send()
586 int fd = ((mbedtls_net_context *) ctx)->fd; in lws_plat_mbedtls_net_recv()