commit - f9cc2426473a2b5619049eacdbee5fdf19c81344
commit + 7d20322689f2c839df114432c36ff372554d6a80
blob - 82597e172e28481545b1081509d53f1f7a7c13bb
blob + 6296fb7dffaf52cc6dd05d3d762673ce0dd2ca2e
--- dispatcher.go
+++ dispatcher.go
return nil, err
}
- resp = newFcall(&MessageRcreate{
+ resp = newFcall(MessageRcreate{
Qid: qid,
IOUnit: iounit,
})
return nil, err
}
- resp = newFcall(&MessageRread{
+ resp = newFcall(MessageRread{
Data: p[:n],
})
case Twrite:
return nil, err
}
- resp = newFcall(&MessageRwrite{
+ resp = newFcall(MessageRwrite{
Count: uint32(n),
})
case Tclunk:
return nil, err
}
- resp = newFcall(&MessageRremove{})
+ resp = newFcall(MessageRremove{})
case Tstat:
reqmsg, ok := req.Message.(MessageTstat)
if !ok {
blob - 07a2464c0eb591b5e43f6f1877c7987e72d339a6
blob + 6fefda0ea6d5e2adaad6f8bd9d3713aec20b09d1
--- errors.go
+++ errors.go
package p9pnew
-import "errors"
+import (
+ "errors"
+ "fmt"
+)
+// MessageRerror provides both a Go error type and message type.
+type MessageRerror struct {
+ Ename string
+}
+
var (
// 9p wire errors returned by Session interface methods
ErrBadattach = new9pError("unknown specifier in attach")
func new9pError(s string) error {
return MessageRerror{Ename: s}
}
+
+func (MessageRerror) Type() FcallType {
+ return Rerror
+}
+
+func (e MessageRerror) Error() string {
+ return fmt.Sprintf("9p: %v", e.Ename)
+}
blob - 5df491e879d897817f19b55450fa6072ca331d95
blob + 144af5861daa0b6ce00ae015d1b6c9d47611dfdf
--- messages.go
+++ messages.go
Qid Qid
}
-type MessageRerror struct {
- Ename string
-}
-
-func (e MessageRerror) Error() string {
- return fmt.Sprintf("9p: %v", e.Ename)
-}
-
type MessageTflush struct {
Oldtag Tag
}
func (MessageRversion) Type() FcallType { return Rversion }
func (MessageTauth) Type() FcallType { return Tauth }
func (MessageRauth) Type() FcallType { return Rauth }
-func (MessageRerror) Type() FcallType { return Rerror }
func (MessageTflush) Type() FcallType { return Tflush }
func (MessageRflush) Type() FcallType { return Rflush }
func (MessageTattach) Type() FcallType { return Tattach }
blob - ae206a0a4d8cb57bea8614eb2f1beb2b5933d616
blob + d909511b3e7ecd51d7f33988af702ac7245590ef
--- types.go
+++ types.go
)
const (
- NOFID = ^Fid(0)
- NOTAG = ^Tag(0)
-)
-
-const (
DMDIR = 0x80000000 // mode bit for directories
DMAPPEND = 0x40000000 // mode bit for append only files
DMEXCL = 0x20000000 // mode bit for exclusive use files
return "unknown"
}
+// Tag uniquely identifies an outstanding fcall in a 9p session.
+type Tag uint16
+
+const NOTAG Tag = ^Tag(0)
+
type Fid uint32
+const NOFID Fid = ^Fid(0)
+
type Qid struct {
Type QType `9p:type,1`
Version uint32
return fmt.Sprintf("dir(%v mode=%v atime=%v mtime=%v length=%v name=%v uid=%v gid=%v muid=%v)",
d.Qid, d.Mode, d.AccessTime, d.ModTime, d.Length, d.Name, d.UID, d.GID, d.MUID)
}
-
-//
-type Tag uint16