Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0363.py @ 2489:e2a7bb875957
plugin pipe/stream, file transfert: refactoring and improvments:
this is a big patch as things had to be changed at the same time.
- changed methods using profile argument to use client instead
- move SatFile in a new tools.stream module, has it should be part of core, not a plugin
- new IStreamProducer interface, to handler starting a pull producer
- new FileStreamObject which create a stream producer/consumer from a SatFile
- plugin pipe is no more using unix named pipe, as it complicate the thing,
special care need to be taken to not block, and it's generally not necessary.
Instead a socket is now used, so the plugin has been renomed to jingle stream.
- bad connection/error should be better handler in jingle stream plugin, and code should not block anymore
- jp pipe commands have been updated accordingly
fix bug 237
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 08 Feb 2018 00:37:42 +0100 |
parents | 0046283a285d |
children | 7ad5f2c4e34a |
comparison
equal
deleted
inserted
replaced
2488:78c7992a26ed | 2489:e2a7bb875957 |
---|---|
167 @param size(int): size of the file to upload | 167 @param size(int): size of the file to upload |
168 @param ignore_tls_errors(bool): ignore TLS certificate is True | 168 @param ignore_tls_errors(bool): ignore TLS certificate is True |
169 @return (tuple | 169 @return (tuple |
170 """ | 170 """ |
171 log.debug(u"Got upload slot: {}".format(slot)) | 171 log.debug(u"Got upload slot: {}".format(slot)) |
172 sat_file = self.host.plugins['FILE'].File(self.host, path, size=size, auto_end_signals=False, profile=client.profile) | 172 sat_file = self.host.plugins['FILE'].File(self.host, client, path, size=size, auto_end_signals=False) |
173 progress_id_d.callback(sat_file.uid) | 173 progress_id_d.callback(sat_file.uid) |
174 file_producer = http_client.FileBodyProducer(sat_file) | 174 file_producer = http_client.FileBodyProducer(sat_file) |
175 if ignore_tls_errors: | 175 if ignore_tls_errors: |
176 agent = http_client.Agent(reactor, NoCheckContextFactory()) | 176 agent = http_client.Agent(reactor, NoCheckContextFactory()) |
177 else: | 177 else: |