summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-28 19:26:43 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-28 19:26:43 +0200
commit6fc8227ebfbdfbbb48b81b679db81f421dbce79b (patch)
treea86b93f53fd7e9035b5293e50740d7898de250e2
parentfec246d2c595164ac3b7e9fe9677053d3739b834 (diff)
patch 7.4.2287v7.4.2287
Problem: The callback passed to ch_sendraw() is not used. Solution: Pass the read part, not the send part. (haya14busa, closes #1019)
-rw-r--r--src/channel.c2
-rw-r--r--src/testdir/test_channel.vim8
-rw-r--r--src/version.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index 7488574238..81c43a5d42 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -3456,7 +3456,7 @@ send_common(
EMSG2(_("E917: Cannot use a callback with %s()"), fun);
return NULL;
}
- channel_set_req_callback(channel, part_send,
+ channel_set_req_callback(channel, *part_read,
opt->jo_callback, opt->jo_partial, id);
}
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 6ecbc789aa..a038d4a2df 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -245,7 +245,6 @@ endfunc
"""""""""
-let g:Ch_reply = ""
func Ch_handler(chan, msg)
unlet g:Ch_reply
let g:Ch_reply = a:msg
@@ -271,8 +270,10 @@ endfunc
func Test_channel_handler()
call ch_log('Test_channel_handler()')
+ let g:Ch_reply = ""
let s:chopt.callback = 'Ch_handler'
call s:run_server('Ch_channel_handler')
+ let g:Ch_reply = ""
let s:chopt.callback = function('Ch_handler')
call s:run_server('Ch_channel_handler')
unlet s:chopt.callback
@@ -443,6 +444,11 @@ func Test_raw_pipe()
let msg = ch_readraw(job)
call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g'))
+ let g:Ch_reply = ""
+ call ch_sendraw(job, "double this\n", {'callback': 'Ch_handler'})
+ call WaitFor('"" != g:Ch_reply')
+ call assert_equal("this\nAND this\n", substitute(g:Ch_reply, "\r", "", 'g'))
+
let reply = ch_evalraw(job, "quit\n", {'timeout': 100})
call assert_equal("Goodbye!\n", substitute(reply, "\r", "", 'g'))
finally
diff --git a/src/version.c b/src/version.c
index a18ce1e174..8ed1a1396d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2287,
+/**/
2286,
/**/
2285,