ry / ebb fork watch download tarball
public this repo is viewable by everyone
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Ensure request is sent even if ebb_client_body_write isn't called
ryah (author)
28 days ago
commit  d906597043802c410acfa44765a63f3d38d9bfa6
tree    4d2aa835bdad00a656a6cf3bc5eb31d830875a80
parent  e73fe87c9085b5ac4c8caf23f6d6ccc85f8933f6
...
524
525
526
 
 
 
 
 
527
 
 
 
 
 
 
 
 
 
528
529
530
...
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
0
@@ -524,7 +524,21 @@ void ebb_client_release(ebb_client *client)
0
 {
0
   assert(client->in_use);
0
   client->in_use = FALSE;
0
+
0
+ if(client->headers_written == FALSE) {
0
+ g_string_append(client->response_buffer, "\r\n");
0
+ client->headers_written = TRUE;
0
+ }
0
   client->body_written = TRUE;
0
+
0
+ /* If the write_watcher isn't yet active, then start it. It could be that
0
+ * we're streaming and the watcher has been stopped. In that case we
0
+ * start it again since we have more to write. */
0
+ if(ev_is_active(&client->write_watcher) == FALSE) {
0
+ set_nonblock(client->fd);
0
+ ev_io_start(client->server->loop, &client->write_watcher);
0
+ }
0
+
0
   if(client->written == client->response_buffer->len)
0
     ebb_client_close(client);
0
 }

Comments

    No one has commented yet.