chiark / gitweb /
*** empty log message ***
[sympathy.git] / apps / mainloop.c
index 3c7d01da7d8088372f8d5014355447a323d77c59..7fb269adeda9c124b405e065d9c475153e4715eb 100644 (file)
@@ -10,6 +10,12 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.8  2008/02/22 23:39:30  james
+ * *** empty log message ***
+ *
+ * Revision 1.7  2008/02/20 20:16:07  james
+ * *** empty log message ***
+ *
  * Revision 1.6  2008/02/20 19:44:37  james
  * @@
  *
@@ -331,7 +337,7 @@ msg_from_server (ANSI *a,IPC_Msg * m, Context * c)
       //FIXME HTML hook
       break;
     case IPC_MSG_TYPE_TERM:
-      vt102_parse (c, m->term.term, m->term.len);
+      tty_parse (c, m->term.term, m->term.len);
       break;
     case IPC_MSG_TYPE_STATUS:
       cmd_new_status (c->d, c, m->status.status);
@@ -419,7 +425,7 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
       if (client_socket)
         socket_pre_select (client_socket, &rfds, &wfds);
 
-      if (ansi)
+      if (ansi && ansi->terminal)
         tty_pre_select (ansi->terminal, &rfds, &wfds);
 
       select (FD_SETSIZE, &rfds, &wfds, NULL, &tv);
@@ -461,7 +467,7 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
             {
               if (clients)
                 send_output (clients, buf, red);
-              vt102_parse (&c, buf, red);
+              tty_parse (&c, buf, red);
             }
         }
 
@@ -470,15 +476,18 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
       /*any data from the server */
       if (client_socket)
         {
+         int one_shot;
           if (socket_post_select (client_socket, &rfds, &wfds))
             break;
 
           while (client_socket->msg)
             {
               if (msg_from_server (ansi,client_socket->msg, &c))
-               break;
+               one_shot++;
+               
               socket_consume_msg (client_socket);
             }
+               if (one_shot) break;
         }