History

Simplified the internal API of the server class and added support for the placeholder Tflush method.

David Boddie committed 8 years ago

Commit 0bb0ec31 parent d95cc451 file · +15 −14Browse files

Unified · Split

styxserver.py+15−14
@@ -47,7 +47,7 @@ class StyxServer: · 46 unmodified lines
4747
4848 try:
4949 handler = self.handlers[message.code]
50− reply = handler(self, conn, client, message)
50+ reply = handler(self, client, message)
5151 except KeyError:
5252 reply = styx.Rerror(message.tag, "Unsupported message.")
5353 except StyxServerError as e:
@@ -58,11 +58,11 @@ class StyxServer: · 4 unmodified lines
5858
5959 reply.encode(conn)
6060
61− def Tversion(self, conn, client, msg):
61+ def Tversion(self, client, msg):
6262
6363 return styx.Rversion(msg.tag, msg.msize, msg.version)
6464
65− def Tattach(self, conn, client, msg):
65+ def Tattach(self, client, msg):
6666
6767 store = self.clients[client]
6868
@@ -72,7 +72,7 @@ class StyxServer: · 3 unmodified lines
7272
7373 return styx.Rattach(msg.tag, qid)
7474
75− def Tstat(self, conn, client, msg):
75+ def Tstat(self, client, msg):
7676
7777 store = self.clients[client]
7878
@@ -82,7 +82,7 @@ class StyxServer: · 3 unmodified lines
8282
8383 return styx.Rstat(msg.tag, s)
8484
85− def Twalk(self, conn, client, msg):
85+ def Twalk(self, client, msg):
8686
8787 store = self.clients[client]
8888
@@ -119,7 +119,7 @@ class StyxServer: · 30 unmodified lines
119119
120120 return styx.Rwalk(msg.tag, qids)
121121
122− def Topen(self, conn, client, msg):
122+ def Topen(self, client, msg):
123123
124124 store = self.clients[client]
125125
@@ -131,7 +131,7 @@ class StyxServer: · 5 unmodified lines
131131
132132 return styx.Ropen(msg.tag, qid, self.MAX_MSG_SIZE)
133133
134− def Tcreate(self, conn, client, msg):
134+ def Tcreate(self, client, msg):
135135
136136 store = self.clients[client]
137137
@@ -149,7 +149,7 @@ class StyxServer: · 11 unmodified lines
149149
150150 return styx.Rcreate(msg.tag, new_qid, self.MAX_MSG_SIZE)
151151
152− def Tread(self, conn, client, msg):
152+ def Tread(self, client, msg):
153153
154154 store = self.clients[client]
155155
@@ -158,7 +158,7 @@ class StyxServer: · 2 unmodified lines
158158
159159 return styx.Rread(msg.tag, data)
160160
161− def Twrite(self, conn, client, msg):
161+ def Twrite(self, client, msg):
162162
163163 store = self.clients[client]
164164
@@ -172,7 +172,7 @@ class StyxServer: · 7 unmodified lines
172172
173173 return styx.Rwrite(msg.tag, count)
174174
175− def Tclunk(self, conn, client, msg):
175+ def Tclunk(self, client, msg):
176176
177177 store = self.clients[client]
178178
@@ -186,7 +186,7 @@ class StyxServer: · 7 unmodified lines
186186
187187 return styx.Rclunk(msg.tag)
188188
189− def Tremove(self, conn, client, msg):
189+ def Tremove(self, client, msg):
190190
191191 store = self.clients[client]
192192
@@ -200,7 +200,7 @@ class StyxServer: · 7 unmodified lines
200200 store.free_qid_path(msg.fid)
201201 return styx.Rerror(msg.tag, result)
202202
203− def Tflush(self, conn, client, msg):
203+ def Tflush(self, client, msg):
204204
205205 store = self.clients[client]
206206
@@ -209,7 +209,7 @@ class StyxServer: · 2 unmodified lines
209209
210210 return styx.Rflush(msg.tag)
211211
212− def Twstat(self, conn, client, msg):
212+ def Twstat(self, client, msg):
213213
214214 store = self.clients[client]
215215
@@ -227,5 +227,6 @@ class StyxServer: · 11 unmodified lines
227227 styx.Twrite.code: Twrite,
228228 styx.Tclunk.code: Tclunk,
229229 styx.Tremove.code: Tremove,
230− styx.Twstat.code: Twstat
230+ styx.Twstat.code: Twstat,
231+ styx.Tflush.code: Tflush
231232 }