Patch 8.2.0466

13 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 28, 2020, 1:07:53 PM3/28/20
to vim...@googlegroups.com

Patch 8.2.0466 (after 8.2.0452)
Problem: Not parsing messages recursively breaks the govim plugin.
Solution: When called recursively do handle messages but do not close
channels.
Files: src/channel.c


*** ../vim-8.2.0465/src/channel.c 2020-03-26 20:33:20.999063758 +0100
--- src/channel.c 2020-03-28 18:05:06.732058264 +0100
***************
*** 4428,4443 ****
int ret = FALSE;
int r;
ch_part_T part = PART_SOCK;
! static int recursive = FALSE;
#ifdef ELAPSED_FUNC
elapsed_T start_tv;
#endif

// The code below may invoke callbacks, which might call us back.
! // That doesn't work well, just return without doing anything.
! if (recursive)
! return FALSE;
! recursive = TRUE;
++safe_to_invoke_callback;

#ifdef ELAPSED_FUNC
--- 4428,4441 ----
int ret = FALSE;
int r;
ch_part_T part = PART_SOCK;
! static int recursive = 0;
#ifdef ELAPSED_FUNC
elapsed_T start_tv;
#endif

// The code below may invoke callbacks, which might call us back.
! // In a recursive call channels will not be closed.
! ++recursive;
++safe_to_invoke_callback;

#ifdef ELAPSED_FUNC
***************
*** 4454,4486 ****
}
while (channel != NULL)
{
! if (channel_can_close(channel))
{
! channel->ch_to_be_closed = (1U << PART_COUNT);
! channel_close_now(channel);
! // channel may have been freed, start over
! channel = first_channel;
! continue;
! }
! if (channel->ch_to_be_freed || channel->ch_killing)
! {
! channel_free_contents(channel);
! if (channel->ch_job != NULL)
! channel->ch_job->jv_channel = NULL;
!
! // free the channel and then start over
! channel_free_channel(channel);
! channel = first_channel;
! continue;
! }
! if (channel->ch_refcount == 0 && !channel_still_useful(channel))
! {
! // channel is no longer useful, free it
! channel_free(channel);
! channel = first_channel;
! part = PART_SOCK;
! continue;
}
if (channel->ch_part[part].ch_fd != INVALID_FD
|| channel_has_readahead(channel, part))
{
--- 4452,4488 ----
}
while (channel != NULL)
{
! if (recursive == 1)
{
! if (channel_can_close(channel))
! {
! channel->ch_to_be_closed = (1U << PART_COUNT);
! channel_close_now(channel);
! // channel may have been freed, start over
! channel = first_channel;
! continue;
! }
! if (channel->ch_to_be_freed || channel->ch_killing)
! {
! channel_free_contents(channel);
! if (channel->ch_job != NULL)
! channel->ch_job->jv_channel = NULL;
!
! // free the channel and then start over
! channel_free_channel(channel);
! channel = first_channel;
! continue;
! }
! if (channel->ch_refcount == 0 && !channel_still_useful(channel))
! {
! // channel is no longer useful, free it
! channel_free(channel);
! channel = first_channel;
! part = PART_SOCK;
! continue;
! }
}
+
if (channel->ch_part[part].ch_fd != INVALID_FD
|| channel_has_readahead(channel, part))
{
***************
*** 4521,4527 ****
}

--safe_to_invoke_callback;
! recursive = FALSE;

return ret;
}
--- 4523,4529 ----
}

--safe_to_invoke_callback;
! --recursive;

return ret;
}
*** ../vim-8.2.0465/src/version.c 2020-03-28 14:53:17.104420156 +0100
--- src/version.c 2020-03-28 18:03:05.564644558 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 466,
/**/

--
GUEST: He's killed the best man!
SECOND GUEST: (holding a limp WOMAN) He's killed my auntie.
FATHER: No, please! This is supposed to be a happy occasion! Let's
not bicker and argue about who killed who ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Paul Jolly

unread,
Mar 28, 2020, 2:15:43 PM3/28/20
to Vim Dev Mailing List
Thanks - I can confirm this fixes things.
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202003281707.02SH7jDB028163%40masaka.moolenaar.net.
Reply all
Reply to author
Forward
0 new messages