Ejemplo n.º 1
0
 def messageReceived(self, request_id, packet):
     # Response Flags:
     #   bit 0:    Cursor Not Found
     #   bit 1:    Query Failure
     #   bit 2:    Shard Config Stale
     #   bit 3:    Await Capable
     #   bit 4-31: Reserved
     QUERY_FAILURE = 1 << 1
     response_flag, cursor_id, start, length = struct.unpack("<iqii", packet[:20])
     if response_flag == QUERY_FAILURE:
         self.queryFailure(request_id, cursor_id, response_flag, bson._to_dicts(packet[20:]))
         return
     self.querySuccess(request_id, cursor_id, bson._to_dicts(packet[20:]))
Ejemplo n.º 2
0
 def messageReceived(self, request_id, packet):
     # Response Flags:
     #   bit 0:    Cursor Not Found
     #   bit 1:    Query Failure
     #   bit 2:    Shard Config Stale
     #   bit 3:    Await Capable
     #   bit 4-31: Reserved
     QUERY_FAILURE = 1 << 1
     response_flag, cursor_id, start, length = struct.unpack(
         "<iqii", packet[:20])
     if response_flag == QUERY_FAILURE:
         self.queryFailure(request_id, cursor_id, response_flag,
                           bson._to_dicts(packet[20:]))
         return
     self.querySuccess(request_id, cursor_id, bson._to_dicts(packet[20:]))
Ejemplo n.º 3
0
 def messageReceived(self, request_id, packet):
     response_flag, cursor_id, start, length = struct.unpack(
         "<iqii", packet[:20])
     if response_flag == 1:
         self.queryFailure(request_id, cursor_id, response_flag,
                           packet[20:])
         return
     self.querySuccess(request_id, cursor_id, bson._to_dicts(packet[20:]))
Ejemplo n.º 4
0
 def messageReceived(self, request_id, packet):
     response_flag, cursor_id, start, length = struct.unpack("<iqii", packet[:20])
     if response_flag == 1:
         self.queryFailure(request_id, cursor_id, response_flag, packet[20:])
         return
     self.querySuccess(request_id, cursor_id, bson._to_dicts(packet[20:]))