Lines Matching refs:vhd
104 struct per_vhost_data__raw_test *vhd =
114 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
117 if (!vhd)
119 vhd->context = lws_get_context(wsi);
120 vhd->protocol = lws_get_protocol(wsi);
121 vhd->vhost = lws_get_vhost(wsi);
127 lws_strncpy(vhd->fifo_path, pvo->value,
128 sizeof(vhd->fifo_path));
131 if (vhd->fifo_path[0] == '\0') {
138 unlink(vhd->fifo_path);
139 if (mkfifo(vhd->fifo_path, 0666)) {
143 vhd->fifo = lws_open(vhd->fifo_path, O_NONBLOCK | O_RDONLY);
144 if (vhd->fifo == -1) {
146 unlink(vhd->fifo_path);
149 lwsl_notice("FIFO %s created\n", vhd->fifo_path);
150 u.filefd = vhd->fifo;
151 if (!lws_adopt_descriptor_vhost(vhd->vhost,
156 close(vhd->fifo);
157 unlink(vhd->fifo_path);
163 if (!vhd)
165 if (vhd->fifo >= 0) {
166 close(vhd->fifo);
167 unlink(vhd->fifo_path);
187 n = (int)read(vhd->fifo, buf, sizeof(buf) - 1);
205 vhd->zero_length_read = 1;
216 if (vhd->zero_length_read) {
217 vhd->zero_length_read = 0;
218 close(vhd->fifo);
222 vhd->fifo = lws_open(vhd->fifo_path,
224 if (vhd->fifo == -1) {
228 lwsl_notice("FIFO %s reopened\n", vhd->fifo_path);
229 u.filefd = vhd->fifo;
230 if (!lws_adopt_descriptor_vhost(vhd->vhost, 0, u,
233 close(vhd->fifo);