Exemple #1
0
 def found_terminator(self):
     if self._current_response is None:
         self._header_buffer.seek(0)
         responseline = self._header_buffer.readline()
         version, status, reason = crack_responseline(responseline)
         if status == 100:
             # Continue header, meaningless.
             self.reset_channel()
             return
         headerlines = self._header_buffer.readlines()
         headers = HeaderDictionary.from_strings(headerlines)
         request = self._sending_requests.pop(0) 
         response = Response(version, status, reason.strip(), headers)
         request.set_response(response)
         self._current_response = response
     self._current_response.found_terminator()
     self._handle_response_update()
Exemple #2
0
 def found_terminator(self):
     if self._current_response is None:
         self._header_buffer.seek(0)
         responseline = self._header_buffer.readline()
         version, status, reason = crack_responseline(responseline)
         if status == 100:
             # Continue header, meaningless.
             self.reset_channel()
             return
         headerlines = self._header_buffer.readlines()
         headers = HeaderDictionary.from_strings(headerlines)
         request = self._sending_requests.pop(0)
         response = Response(version, status, reason.strip(), headers)
         request.set_response(response)
         self._current_response = response
     self._current_response.found_terminator()
     self._handle_response_update()