From b6ae9475ba47b3e007cebba47c5ab2440cd85c06 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 11:16:49 +1000 Subject: [PATCH] Partially implemented sendReply. --- connection.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/connection.go b/connection.go index 65796e7..50bfcc0 100644 --- a/connection.go +++ b/connection.go @@ -15,7 +15,6 @@ package fuse import ( - "errors" "fmt" "log" "path" @@ -236,13 +235,17 @@ func (c *Connection) ReadOp() (op fuseops.Op, err error) { sendReply := func( fuseID uint64, - msg []byte, + replyMsg []byte, opErr error) (err error) { - // TODO(jacobsa): Turn this into a method and maybe kill the fuseID - // parameter. - // - // TODO(jacobsa): Don't forget to destroy the message. - err = errors.New("TODO") + // Clean up state for this op. + c.finishOp(m.Hdr.Opcode, m.Hdr.Unique) + + // Send the reply to the kernel. + panic("TODO") + + // Destroy the message, as required by fuseshim.Connection.ReadMessage. + m.Destroy() + return }