Lines Matching refs:vhd

81 struct vhd {
102 struct vhd *bind_partner_vhd;
137 struct vhd *vhd = lws_container_of(sul, struct vhd, sul);
144 lwsl_notice("%s: %s %s %s\n", __func__, vhd->ws_server_uri, vhd->metrics_proxy_path, vhd->ba_secret);
146 lws_strncpy(url, vhd->ws_server_uri, sizeof(url));
150 vhd->ws_server_uri);
154 i.context = vhd->cx;
160 i.pwsi = &vhd->wsi;
162 i.userdata = vhd;
163 i.vhost = vhd->vhost;
175 if (!lws_retry_sul_schedule(vhd->cx, 0, sul, &retry,
176 omc_connect_client, &vhd->retry_count))
179 vhd->retry_count = 0;
180 lws_retry_sul_schedule(vhd->cx, 0, sul, &retry,
181 omc_connect_client, &vhd->retry_count);
549 omc_lws_om_get_other_side_pss_client(struct vhd *vhd, struct pss *pss)
556 vhd->bind_partner_vhd->clients.head) {
576 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get(
589 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
590 lws_get_protocol(wsi), sizeof(struct vhd));
591 if (!vhd) {
592 lwsl_err("%s: vhd alloc failed\n", __func__);
596 vhd->cx = cx;
606 &vhd->proxy_side_bind_name)) {
608 * Attempt to find the vhd that belongs to a vhost
612 * vhd->proxy_side_bind_name was also set to.
615 * what their partner vhd is
617 lws_strncpy(vhd->sanity, "isagg", sizeof(vhd->sanity));
618 vhd->bind_partner_vhd = lws_vhd_find_by_pvo(cx,
621 vhd->proxy_side_bind_name);
622 if (vhd->bind_partner_vhd) {
623 assert(!strcmp(vhd->bind_partner_vhd->sanity, "isws"));
625 vhd->bind_partner_vhd->bind_partner_vhd = vhd;
635 if (vhd)
636 lws_sul_cancel(&vhd->sul);
646 if (!vhd->bind_partner_vhd)
660 vhd->bind_partner_vhd->clients.head) {
667 /* let's add him on the http server vhd list */
669 lws_dll2_add_tail(&pss->list, &vhd->clients);
689 partner_pss = omc_lws_om_get_other_side_pss_client(vhd, pss);
751 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get(
765 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
766 lws_get_protocol(wsi), sizeof(struct vhd));
767 if (!vhd) {
768 lwsl_err("%s: vhd alloc failed\n", __func__);
772 vhd->cx = cx;
782 &vhd->proxy_side_bind_name)) {
784 * Attempt to find the vhd that belongs to a vhost
788 * vhd->proxy_side_bind_name was also set to.
791 * what their partner vhd is
793 lws_strncpy(vhd->sanity, "isws", sizeof(vhd->sanity));
794 vhd->bind_partner_vhd = lws_vhd_find_by_pvo(cx,
797 vhd->proxy_side_bind_name);
798 if (vhd->bind_partner_vhd) {
799 assert(!strcmp(vhd->bind_partner_vhd->sanity, "isagg"));
801 vhd->bind_partner_vhd->bind_partner_vhd = vhd;
833 (unsigned int)vhd->clients.count);
837 partner_pss = omc_lws_om_get_other_side_pss_client(vhd, pss);
855 lws_dll2_add_tail(&pss->list, &vhd->clients);
877 partner_pss = omc_lws_om_get_other_side_pss_client(vhd, pss);
909 partner_pss = omc_lws_om_get_other_side_pss_client(vhd, pss);
945 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get(
964 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
965 lws_get_protocol(wsi), sizeof(struct vhd));
966 if (!vhd)
969 vhd->cx = cx;
970 vhd->vhost = lws_get_vhost(wsi);
979 lws_strncpy(vhd->ws_server_uri, cp, sizeof(vhd->ws_server_uri));
988 lws_strncpy(vhd->metrics_proxy_path, cp, sizeof(vhd->metrics_proxy_path));
997 lws_strncpy(vhd->ba_secret, cp, sizeof(vhd->ba_secret));
1000 vhd->ws_server_uri, vhd->metrics_proxy_path, vhd->ba_secret);
1003 lws_sul_schedule(cx, 0, &vhd->sul, omc_connect_client, 1);
1007 if (vhd)
1008 lws_sul_cancel(&vhd->sul);
1018 if (lws_http_basic_auth_gen("metricsclient", vhd->ba_secret,
1068 vhd->metrics_proxy_path);
1069 lws_strncpy((char *)start, vhd->metrics_proxy_path,
1072 strlen(vhd->metrics_proxy_path),
1146 if (!lws_retry_sul_schedule(cx, 0, &vhd->sul, &retry,
1147 omc_connect_client, &vhd->retry_count))
1150 vhd->retry_count = 0;
1151 lws_retry_sul_schedule(cx, 0, &vhd->sul, &retry,
1152 omc_connect_client, &vhd->retry_count);