Commit be9ce205 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Rename stream Read/Write to Recv/Send to match the C API

The Go binding seeks to match C API naming in general.
Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
parent 40fb7333
......@@ -1273,7 +1273,7 @@ func TestStorageVolUploadDownload(t *testing.T) {
}
// 3. do the actual writing
if n, err := stream.Write(data); err != nil || n != len(data) {
if n, err := stream.Send(data); err != nil || n != len(data) {
t.Fatal(err, n)
}
......@@ -1300,7 +1300,7 @@ func TestStorageVolUploadDownload(t *testing.T) {
// 3. do the actual reading
buf := make([]byte, 1024)
if n, err := downStream.Read(buf); err != nil || n != len(data) {
if n, err := downStream.Recv(buf); err != nil || n != len(data) {
t.Fatal(err, n)
}
......
......@@ -84,7 +84,7 @@ func (v *Stream) Free() error {
return nil
}
func (v *Stream) Read(p []byte) (int, error) {
func (v *Stream) Recv(p []byte) (int, error) {
n := C.virStreamRecv(v.ptr, (*C.char)(unsafe.Pointer(&p[0])), C.size_t(len(p)))
if n < 0 {
return 0, GetLastError()
......@@ -96,7 +96,7 @@ func (v *Stream) Read(p []byte) (int, error) {
return int(n), nil
}
func (v *Stream) Write(p []byte) (int, error) {
func (v *Stream) Send(p []byte) (int, error) {
n := C.virStreamSend(v.ptr, (*C.char)(unsafe.Pointer(&p[0])), C.size_t(len(p)))
if n < 0 {
return 0, GetLastError()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment