| 535 | | file_props['type'] |
| | 531 | if streamhost is None: |
| | 532 | # proxy approves the activate query |
| | 533 | if real_id[:3] == 'au_': |
| | 534 | id = real_id[3:] |
| | 535 | if not file_props.has_key('streamhost-used') or \ |
| | 536 | file_props['streamhost-used'] is False: |
| | 537 | raise common.xmpp.NodeProcessed |
| | 538 | if not file_props.has_key('proxyhosts'): |
| | 539 | raise common.xmpp.NodeProcessed |
| | 540 | for host in file_props['proxyhosts']: |
| | 541 | if host['initiator'] == frm and \ |
| | 542 | str(query.getAttr('sid')) == file_props['sid']: |
| | 543 | gajim.socks5queue.activate_proxy(host['idx']) |
| | 544 | break |
| | 545 | raise common.xmpp.NodeProcessed |
| | 546 | jid = streamhost.getAttr('jid') |
| | 583 | def remove_all_transfers(self): |
| | 584 | ''' stops and removes all active connections from the socks5 pool ''' |
| | 585 | for file_props in self.files_props.values(): |
| | 586 | self.remove_transfer(file_props, remove_from_list = False) |
| | 587 | del(self.files_props) |
| | 588 | self.files_props = {} |
| | 589 | |
| | 590 | def remove_transfer(self, file_props, remove_from_list = True): |
| | 591 | if file_props.has_key('hash'): |
| | 592 | gajim.socks5queue.remove_sender(file_props['hash']) |
| | 593 | |
| | 594 | if file_props.has_key('streamhosts'): |
| | 595 | for host in file_props['streamhosts']: |
| | 596 | if host['idx'] > 0: |
| | 597 | gajim.socks5queue.remove_receiver(host['idx']) |
| | 598 | gajim.socks5queue.remove_sender(host['idx']) |
| | 599 | sid = file_props['sid'] |
| | 600 | gajim.socks5queue.remove_file_props(self.name, sid) |
| | 601 | |
| | 602 | if remove_from_list: |
| | 603 | if self.files_props.has_key('sid'): |
| | 604 | del(self.files_props['sid']) |
| | 605 | |
| | 606 | def disconnect_transfer(self, file_props): |
| | 607 | if file_props.has_key('hash'): |
| | 608 | gajim.socks5queue.remove_sender(file_props['hash']) |
| | 609 | |
| | 610 | if file_props.has_key('streamhosts'): |
| | 611 | for host in file_props['streamhosts']: |
| | 612 | if host['idx'] > 0: |
| | 613 | gajim.socks5queue.remove_receiver(host['idx']) |
| | 614 | gajim.socks5queue.remove_sender(host['idx']) |
| | 615 | |