Exemple #1
0
 def operative(self, data):
     if data:
         return State.get_final(close=True)
     push = ' '.join([self._method, self._path, HTTP])
     for k, v in self._headers.iteritems():
         push += CRLF + k + ': ' + v
     push += CRLF * 2
     return State.get_push(push=push)
Exemple #2
0
 def initial(self, data):
     return State.get_push(terminator=CRLF * 2)