• Home
  • Raw
  • Download

Lines Matching refs:self

32     def __init__(self):  argument
33 self.log = log.Log.getInstance()
35 def write(self, data): argument
36 self.log("BaseProtocol.write()", len(data), data)
37 return self.transport.write(data)
39 def dataReceived(self, data): argument
40 self.log("BaseProtocol.dataReceived()", len(data), data)
42 def connectionMade(self): argument
43 self.log("BaseProtocol.connectionMade()")
44 self.transport.setTcpNoDelay(1) # send immediately
46 def connectionLost(self, reason): argument
47 self.log("BaseProtocol.connectionLost():", reason)
49 def sendResponse(self, response): argument
50 self.write("HTTP/1.1 200 OK\r\n")
51 self.write("Content-Length: %d\r\n\r\n" % len(response))
53 self.write(response)
62 def connectionMade(self): argument
63 BaseProtocol.connectionMade(self)
64 self.transport.loseConnection()
69 def dataReceived(self, data): argument
70 BaseProtocol.dataReceived(self, data)
71 self.transport.loseConnection()
76 def dataReceived(self, data): argument
77 BaseProtocol.dataReceived(self, data)
78 self.write("welcome to the jungle baby\r\n")
83 def dataReceived(self, data): argument
84 BaseProtocol.dataReceived(self, data)
85 self.write("HTTP/1.1 200 OK\r\n")
86 self.write("Cache-Contr")
88 self.transport.loseConnection()
93 def dataReceived(self, data): argument
94 BaseProtocol.dataReceived(self, data)
95 self.write("HTTP/1.1 200 OK\r\n")
96 self.write("Cache-Contr")
98 self.write("ol: private\r\n\r\nwe've got fun and games")
100 self.transport.loseConnection()
104 def dataReceived(self, data): argument
105 BaseProtocol.dataReceived(self, data)
106 self.write("HTTP/1.1 302 Moved Temporarily\r\n")
107 self.write("Content-Length: 0\r\n")
108self.write("Location: http://shopping.yahoo.com/p:Canon PowerShot SD630 Digital Camera:1993588104;…
109 self.transport.loseConnection()
114 def dataReceived(self, data): argument
116 self.write("HTTP/1.1 404 Not Found\r\n\r\n")
117 self.transport.loseConnection()
120 BaseProtocol.dataReceived(self, data)
121 self.write("HTTP/1.1 200 OK\r\n")
123 self.write("\r\n")
126 self.transport.loseConnection()
132 def dataReceived(self, data): argument
133 BaseProtocol.dataReceived(self, data)
134 self.write("HTTP/1.1 200 OK\r\n")
135 self.write("Content-Length: 5\r\n\r\n")
138 self.write("HE")
140 self.write("HELLO")
141 self.transport.loseConnection()
148 def dataReceived(self, data): argument
149 BaseProtocol.dataReceived(self, data)
150 self.write("HTTP/1.1 200 OK\n")
151 self.write("Content-Length: 5\n\n")
153 self.write("HELLO")
154 self.transport.loseConnection()
159 def dataReceived(self, data): argument
160 BaseProtocol.dataReceived(self, data)
162 self.write("HTTP/1.1 200 OK\n")
163 self.write("Content-Length: 943\n\n")
165 self.write(open("./stfu.jpg").read())
169 self.transport.loseConnection()
175 def dataReceived(self, data): argument
176 BaseProtocol.dataReceived(self, data)
177 self.write("HTTP/1.1 302 Moved Temporarily\r\n")
178 self.write("Content-Length: 0\r\n")
179 self.write("Location: http://localhost:8011/\r\n")
180 self.write("\r\n")
181 self.transport.loseConnection()
187 def connectionMade(self): argument
188 self.count = 0
190 def dataReceived(self, data): argument
191 BaseProtocol.dataReceived(self, data)
192 self.count += len(data)
193 if self.count == 190890:
194 self.transport.loseConnection()
200 def connectionMade(self): argument
201 self.count = 0
203 def dataReceived(self, data): argument
204 BaseProtocol.dataReceived(self, data)
205 if self.count == 0: self.write("HTTP/1.1 200 OK\r\n\r\n")
206 self.count += 1
212 def connectionMade(self): argument
213 self.count = 0
215 def dataReceived(self, data): argument
216 BaseProtocol.dataReceived(self, data)
217 if self.count == 0: self.write("HTTP/1.1 200 OK\r\n\r\n")
218 self.sendPack(0)
220 def sendPack(self, count): argument
222 self.transport.loseConnection()
224 self.write("all work and no play makes jack a dull boy %s\n" % count)
226 d.addCallback(self.sendPack)