mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: pure-runner violates io Writer contract (#981)
We must copy the data slice.
This commit is contained in:
@@ -400,10 +400,14 @@ func (ch *callHandle) Write(data []byte) (int, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we cannot retain 'data'
|
||||||
|
cpData := make([]byte, len(data))
|
||||||
|
copy(cpData, data)
|
||||||
|
|
||||||
err = ch.enqueueMsg(&runner.RunnerMsg{
|
err = ch.enqueueMsg(&runner.RunnerMsg{
|
||||||
Body: &runner.RunnerMsg_Data{
|
Body: &runner.RunnerMsg_Data{
|
||||||
Data: &runner.DataFrame{
|
Data: &runner.DataFrame{
|
||||||
Data: data,
|
Data: cpData,
|
||||||
Eof: false,
|
Eof: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user