(self, data, callback, errback, timeout = 30)
| 2962 | sendOpen(self.connected_trees[service_name]) |
| 2963 | |
| 2964 | def _echo_SMB1(self, data, callback, errback, timeout = 30): |
| 2965 | messages_history = [ ] |
| 2966 | |
| 2967 | if not isinstance(data, type(b'')): |
| 2968 | raise TypeError('Echo data must be %s not %s' % (type(b'').__name__, type(data).__name__)) |
| 2969 | |
| 2970 | def echoCB(echo_message, **kwargs): |
| 2971 | self._pushToArray(messages_history, echo_message) |
| 2972 | if not echo_message.status.hasError: |
| 2973 | callback(echo_message.payload.data) |
| 2974 | else: |
| 2975 | errback(OperationFailure('Echo failed', messages_history)) |
| 2976 | |
| 2977 | m = SMBMessage(ComEchoRequest(echo_data = data)) |
| 2978 | self._sendSMBMessage(m) |
| 2979 | self.pending_requests[m.mid] = _PendingRequest(m.mid, int(time.time()) + timeout, echoCB, errback) |
| 2980 | self._pushToArray(messages_history, m) |
| 2981 | |
| 2982 | def _extractLastPathComponent(self, path): |
| 2983 | return path.replace('\\', '/').split('/')[-1] |
nothing calls this directly
no test coverage detected