comparison src/c/urweb.c @ 1665:f9ffe8497742

Fix channel delivery to handle sending of messages for channels whose clients haven't connected yet
author Adam Chlipala <adam@chlipala.net>
date Sun, 08 Jan 2012 15:47:05 -0500
parents 4682b312e9d5
children a54d223c3a7f
comparison
equal deleted inserted replaced
1664:a12186d99e4f 1665:f9ffe8497742
331 c->send(c->sock, "\n", 1); 331 c->send(c->sock, "\n", 1);
332 } 332 }
333 c->send(c->sock, msg->start, uw_buffer_used(msg)); 333 c->send(c->sock, msg->start, uw_buffer_used(msg));
334 c->close(c->sock); 334 c->close(c->sock);
335 c->sock = -1; 335 c->sock = -1;
336 } else if ((script_len > 0 336 } else if (uw_buffer_append(&c->msgs, msg->start, uw_buffer_used(msg)))
337 && (c->send(c->sock, "E\n", 2)
338 || c->send(c->sock, script, script_len)
339 || c->send(c->sock, "\n", 1)))
340 || uw_buffer_append(&c->msgs, msg->start, uw_buffer_used(msg)))
341 fprintf(stderr, "Client message buffer size exceeded"); 337 fprintf(stderr, "Client message buffer size exceeded");
342 338
343 pthread_mutex_unlock(&c->lock); 339 pthread_mutex_unlock(&c->lock);
344 } 340 }
345 341