Home | History | Annotate | Download | only in axl

Lines Matching refs:self

32     def __init__(self):
33 self.log = log.Log.getInstance()
35 def write(self, data):
36 self.log("BaseProtocol.write()", len(data), data)
37 return self.transport.write(data)
39 def dataReceived(self, data):
40 self.log("BaseProtocol.dataReceived()", len(data), data)
42 def connectionMade(self):
43 self.log("BaseProtocol.connectionMade()")
44 self.transport.setTcpNoDelay(1) # send immediately
46 def connectionLost(self, reason):
47 self.log("BaseProtocol.connectionLost():", reason)
49 def sendResponse(self, response):
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):
63 BaseProtocol.connectionMade(self)
64 self.transport.loseConnection()
69 def dataReceived(self, data):
70 BaseProtocol.dataReceived(self, data)
71 self.transport.loseConnection()
76 def dataReceived(self, data):
77 BaseProtocol.dataReceived(self, data)
78 self.write("welcome to the jungle baby\r\n")
83 def dataReceived(self, data):
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):
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):
105 BaseProtocol.dataReceived(self, data)
106 self.write("HTTP/1.1 302 Moved Temporarily\r\n")
107 self.write("Content-Length: 0\r\n")
108 self.write("Location: http://shopping.yahoo.com/p:Canon PowerShot SD630 Digital Camera:1993588104;_ylc=X3oDMTFhZXNmcjFjBF9TAzI3MTYxNDkEc2VjA2ZwLXB1bHNlBHNsawNyc3NfcHVsc2U0LmluYw--\r\n\r\n")
109 self.transport.loseConnection()
114 def dataReceived(self, data):
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")
122 # self.write("Content-Length: 100\r\n\r\n")
123 self.write("\r\n")
124 # self.write("Data cuts off < 100 here!")
126 self.transport.loseConnection()
132 def dataReceived(self, data):
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):
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):
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):
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):
188 self.count = 0
190 def dataReceived(self, data):
191 BaseProtocol.dataReceived(self, data)
192 self.count += len(data)
193 if self.count == 190890:
194 self.transport.loseConnection()
200 def connectionMade(self):
201 self.count = 0
203 def dataReceived(self, data):
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):
213 self.count = 0
215 def dataReceived(self, data):
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):
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)