[BACK]Return to control.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/control.c between version 1.36 and 1.37

version 1.36, 2020/06/01 21:08:05 version 1.37, 2020/06/02 08:17:27
Line 45 
Line 45 
 struct control_block {  struct control_block {
         size_t                           size;          size_t                           size;
         char                            *line;          char                            *line;
           uint64_t                         t;
   
         TAILQ_ENTRY(control_block)       entry;          TAILQ_ENTRY(control_block)       entry;
         TAILQ_ENTRY(control_block)       all_entry;          TAILQ_ENTRY(control_block)       all_entry;
Line 152 
Line 153 
         return (cp);          return (cp);
 }  }
   
   /* Get actual pane for this client. */
   static struct window_pane *
   control_window_pane(struct client *c, u_int pane)
   {
           struct window_pane      *wp;
   
           if (c->session == NULL)
                   return (NULL);
           if ((wp = window_pane_find_by_id(pane)) == NULL)
                   return (NULL);
           if (winlink_find_by_window(&c->session->windows, wp->window) == NULL)
                   return (NULL);
           return (wp);
   }
   
 /* Reset control offsets. */  /* Reset control offsets. */
 void  void
 control_reset_offsets(struct client *c)  control_reset_offsets(struct client *c)
Line 253 
Line 269 
         cb = xcalloc(1, sizeof *cb);          cb = xcalloc(1, sizeof *cb);
         xvasprintf(&cb->line, fmt, ap);          xvasprintf(&cb->line, fmt, ap);
         TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);          TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);
           cb->t = get_timer();
   
         log_debug("%s: %s: storing line: %s", __func__, c->name, cb->line);          log_debug("%s: %s: storing line: %s", __func__, c->name, cb->line);
         bufferevent_enable(cs->write_event, EV_WRITE);          bufferevent_enable(cs->write_event, EV_WRITE);
Line 290 
Line 307 
         cb = xcalloc(1, sizeof *cb);          cb = xcalloc(1, sizeof *cb);
         cb->size = new_size;          cb->size = new_size;
         TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);          TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);
           cb->t = get_timer();
   
         TAILQ_INSERT_TAIL(&cp->blocks, cb, entry);          TAILQ_INSERT_TAIL(&cp->blocks, cb, entry);
         log_debug("%s: %s: new output block of %zu for %%%u", __func__, c->name,          log_debug("%s: %s: new output block of %zu for %%%u", __func__, c->name,
Line 446 
Line 464 
 control_write_pending(struct client *c, struct control_pane *cp, size_t limit)  control_write_pending(struct client *c, struct control_pane *cp, size_t limit)
 {  {
         struct control_state    *cs = c->control_state;          struct control_state    *cs = c->control_state;
         struct session          *s = c->session;  
         struct window_pane      *wp = NULL;          struct window_pane      *wp = NULL;
         struct evbuffer         *message = NULL;          struct evbuffer         *message = NULL;
         size_t                   used = 0, size;          size_t                   used = 0, size;
         struct control_block    *cb, *cb1;          struct control_block    *cb, *cb1;
   
         if (s == NULL ||          wp = control_window_pane(c, cp->pane);
             (wp = window_pane_find_by_id(cp->pane)) == NULL ||          if (wp == NULL) {
             winlink_find_by_window(&s->windows, wp->window) == NULL) {  
                 TAILQ_FOREACH_SAFE(cb, &cp->blocks, entry, cb1) {                  TAILQ_FOREACH_SAFE(cb, &cp->blocks, entry, cb1) {
                         TAILQ_REMOVE(&cp->blocks, cb, entry);                          TAILQ_REMOVE(&cp->blocks, cb, entry);
                         control_free_block(cs, cb);                          control_free_block(cs, cb);

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37