(find_message, **kwargs)
| 2309 | self._pushToArray(messages_history, m) |
| 2310 | |
| 2311 | def findNextCB(find_message, **kwargs): |
| 2312 | self._pushToArray(messages_history, find_message) |
| 2313 | if not find_message.status.hasError: |
| 2314 | if 'total_count' not in kwargs: |
| 2315 | # TRANS2_FIND_NEXT2 response. [MS-CIFS]: 2.2.6.3.2 |
| 2316 | search_count, end_of_search, _, last_name_offset = struct.unpack('<HHHH', find_message.payload.params_bytes[:8]) |
| 2317 | kwargs.update({ 'end_of_search': end_of_search, 'last_name_offset': last_name_offset, 'data_buf': b'' }) |
| 2318 | else: |
| 2319 | end_of_search, last_name_offset = kwargs['end_of_search'], kwargs['last_name_offset'] |
| 2320 | |
| 2321 | send_next = True |
| 2322 | if find_message.payload.data_bytes: |
| 2323 | d = decodeFindStruct(kwargs['data_buf'] + find_message.payload.data_bytes) |
| 2324 | if 'data_count' not in kwargs: |
| 2325 | if len(find_message.payload.data_bytes) != find_message.payload.total_data_count: |
| 2326 | kwargs.update({ 'data_count': len(find_message.payload.data_bytes), |
| 2327 | 'total_count': find_message.payload.total_data_count, |
| 2328 | 'data_buf': d, |
| 2329 | }) |
| 2330 | send_next = False |
| 2331 | else: |
| 2332 | kwargs['data_count'] += len(find_message.payload.data_bytes) |
| 2333 | kwargs['total_count'] = min(find_message.payload.total_data_count, kwargs['total_count']) |
| 2334 | kwargs['data_buf'] = d |
| 2335 | if kwargs['data_count'] != kwargs['total_count']: |
| 2336 | send_next = False |
| 2337 | |
| 2338 | if not send_next: |
| 2339 | self.pending_requests[find_message.mid] = _PendingRequest(find_message.mid, expiry_time, findNextCB, errback, **kwargs) |
| 2340 | elif end_of_search: |
| 2341 | callback(results) |
| 2342 | else: |
| 2343 | sendFindNext(find_message.tid, kwargs['sid'], 0, results[-1].filename, kwargs.get('support_dfs', False)) |
| 2344 | else: |
| 2345 | errback(OperationFailure('Failed to list %s on %s: Unable to retrieve file list' % ( path, service_name ), messages_history)) |
| 2346 | |
| 2347 | def sendDFSReferral(tid): |
| 2348 | setup_bytes = struct.pack('<H', 0x0010) # TRANS2_GET_DFS_REFERRAL sub-command. See [MS-CIFS]: 2.2.6.16.1 |
nothing calls this directly
no test coverage detected