Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
3759d612 by Jeff 'Raid' Baitis at 2018-01-22T11:49:37-08:00
Unit test the SelectIdleQueue (and not an unusued implementation)
- - - - -
bf7f89a6 by Jeff 'Raid' Baitis at 2018-01-22T11:49:37-08:00
Correct logic error in code that checks for infile handles
- - - - -
9a1b179d by Jeff 'Raid' Baitis at 2018-01-22T11:49:37-08:00
Remove unused implementation of process() in the superclass.
- - - - -
9d40e12a by Jeff 'Raid' Baitis at 2018-01-22T11:49:37-08:00
Make file flags consistent with the two different implementations of
IOQueue as using hard-coded integer values makes some assumptions about
the underlying GLIB implementation.
- - - - -
aba046ac by Jeff 'Raid' Baitis at 2018-01-22T11:49:37-08:00
Formatting clean-up and additional comments regarding flags for clarity
- - - - -
5a37180d by Philipp Hörist at 2018-01-23T23:38:48+01:00
Merge branch 'master' into 'master'
Cleanups, fix for logic error in code that checks for invalid file handles
See merge request gajim/python-nbxmpp!13
- - - - -
2 changed files:
- nbxmpp/idlequeue.py
- test/lib/xmpp_mocks.py
Changes:
=====================================
nbxmpp/idlequeue.py
=====================================
--- a/nbxmpp/idlequeue.py
+++ b/nbxmpp/idlequeue.py
@@ -44,21 +44,23 @@ elif os.name == 'posix':
import fcntl
if sys.version_info[0] == 2 or not HAVE_GLIB:
- FLAG_WRITE = 20 # write only
- FLAG_READ = 19 # read only
- FLAG_READ_WRITE = 23 # read and write
- FLAG_CLOSE = 16 # wait for close
+ FLAG_WRITE = 20 # write only 10100
+ FLAG_READ = 19 # read only 10011
+ FLAG_READ_WRITE = 23 # read and write 10111
+ FLAG_CLOSE = 16 # wait for close 10000
+ PENDING_READ = 3 # waiting read event 11
+ PENDING_WRITE = 4 # waiting write event 100
+ IS_CLOSED = 16 # channel closed 10000
else:
FLAG_WRITE = GLib.IOCondition.OUT | GLib.IOCondition.HUP
- FLAG_READ = GLib.IOCondition.IN | GLib.IOCondition.PRI | \
- GLib.IOCondition.HUP
+ FLAG_READ = GLib.IOCondition.IN | GLib.IOCondition.PRI | \
+ GLib.IOCondition.HUP
FLAG_READ_WRITE = GLib.IOCondition.OUT | GLib.IOCondition.IN | \
- GLib.IOCondition.PRI | GLib.IOCondition.HUP
- FLAG_CLOSE = GLib.IOCondition.HUP
-
-PENDING_READ = 3 # waiting read event
-PENDING_WRITE = 4 # waiting write event
-IS_CLOSED = 16 # channel closed
+ GLib.IOCondition.PRI | GLib.IOCondition.HUP
+ FLAG_CLOSE = GLib.IOCondition.HUP
+ PENDING_READ = GLib.IOCondition.IN # There is data to read.
+ PENDING_WRITE = GLib.IOCondition.OUT # Data CAN be written without blocking.
+ IS_CLOSED = GLib.IOCondition.HUP # Hung up (connection broken)
def get_idlequeue():
"""
@@ -426,26 +428,15 @@ class IdleQueue(object):
def process(self):
"""
+ This function must be overridden by an implementation of the IdleQueue.
+
Process idlequeue. Check for any pending timeout or alarm events. Call
IdleObjects on possible and requested read, write and error events on
their file descriptors
Call this in regular intervals.
"""
- if not self.queue:
- # check for timeouts/alert also when there are no active fds
- self._check_time_events()
- return True
- try:
- waiting_descriptors = self.selector.poll(0)
- except OSError as e:
- waiting_descriptors = []
- if e.errno != errno.EINTR:
- raise
- for fd, flags in waiting_descriptors:
- self._process_events(fd, flags)
- self._check_time_events()
- return True
+ raise NotImplementedError("You need to define a process() method.")
class SelectIdleQueue(IdleQueue):
"""
@@ -474,10 +465,8 @@ class SelectIdleQueue(IdleQueue):
for fd in (bad_fds):
obj = self.queue.get(fd)
- if obj is None:
- self.unplug_idle(fd)
- return
- self.remove_timeout(fd)
+ if obj is not None:
+ self.remove_timeout(fd)
self.unplug_idle(fd)
def _init_idle(self):
=====================================
test/lib/xmpp_mocks.py
=====================================
--- a/test/lib/xmpp_mocks.py
+++ b/test/lib/xmpp_mocks.py
@@ -16,7 +16,7 @@ class IdleQueueThread(threading.Thread):
Thread for regular processing of idlequeue.
'''
def __init__(self):
- self.iq = idlequeue.IdleQueue()
+ self.iq = idlequeue.SelectIdleQueue()
self.stop = threading.Event() # Event to stop the thread main loop.
self.stop.clear()
threading.Thread.__init__(self)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/e064374efac494e03973fa45f…
---
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/e064374efac494e03973fa45f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3ee3ce67 by Daniel at 2018-01-22T11:55:32+01:00
Add translation for corrected messages
- - - - -
c23af9c9 by Philipp Hörist at 2018-01-22T17:16:13+01:00
Merge branch 'translation' into 'master'
Add translation for corrected messages
See merge request gajim/gajim!198
- - - - -
1 changed file:
- gajim/conversation_textview.py
Changes:
=====================================
gajim/conversation_textview.py
=====================================
--- a/gajim/conversation_textview.py
+++ b/gajim/conversation_textview.py
@@ -1103,7 +1103,7 @@ class ConversationTextview(GObject.GObject):
del self.corrected_text_list[correct_id]
else:
self.corrected_text_list[msg_stanza_id] = \
- '<b>Message corrected. Previous message:</b>\n{}' \
+ _('<b>Message corrected. Original message:</b>\n{}') \
.format(GLib.markup_escape_text(old_txt))
corrected = True
except TypeError:
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/91cc5cd33a58d36b651ab50b6592138c6…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/91cc5cd33a58d36b651ab50b6592138c6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
71fb3d0b by Philipp Hörist at 2018-01-21T21:52:32+01:00
Improve network speed on Windows
Call select.select() with the smallest timeout possible
- - - - -
1 changed file:
- gajim/gui_interface.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2342,7 +2342,13 @@ class Interface:
# Otherwise, an exception will stop our loop
if sys.platform == 'win32':
- timeout, in_seconds = 20, None
+ # On Windows process() calls select.select(), so we need this
+ # executed as often as possible.
+ # Adding it directly with GLib.idle_add() causes Gajim to use
+ # too much CPU time. Thats why its added with 1ms timeout.
+ # On Linux only alarms are checked in process(), so we use
+ # a bigger timeout
+ timeout, in_seconds = 1, None
else:
timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/71fb3d0b4f7657dcf6d4e3dcc039080c61…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/71fb3d0b4f7657dcf6d4e3dcc039080c61…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
4aadc00b by Philipp Hörist at 2018-01-21T20:45:32+01:00
Revert "Improve speed of Windows client"
This reverts commit 45e3139bd0a224e2a34f133849309afaab4c6338
- - - - -
1 changed file:
- gajim/gui_interface.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2342,14 +2342,10 @@ class Interface:
# Otherwise, an exception will stop our loop
if sys.platform == 'win32':
- # On Windows process() calls select.select(), so we need this
- # executed on each mainloop cycle
- # On Linux only timeouts are checked in process(), so we use
- # a timeout
- GLib.idle_add(self.process_connections)
- raise
+ timeout, in_seconds = 20, None
+ else:
+ timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT
- timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT
if in_seconds:
GLib.timeout_add_seconds(timeout, self.process_connections)
else:
@@ -2636,16 +2632,15 @@ class Interface:
self.instances['file_transfers'] = dialogs.FileTransfersWindow()
GLib.timeout_add(100, self.autoconnect)
-
if sys.platform == 'win32':
- GLib.idle_add(self.process_connections)
+ timeout, in_seconds = 20, None
else:
timeout, in_seconds = app.idlequeue.PROCESS_TIMEOUT
- if in_seconds:
- GLib.timeout_add_seconds(timeout, self.process_connections)
- else:
- GLib.timeout_add(self.process_connections)
+ if in_seconds:
+ GLib.timeout_add_seconds(timeout, self.process_connections)
+ else:
+ GLib.timeout_add(timeout, self.process_connections)
GLib.timeout_add_seconds(app.config.get(
'check_idle_every_foo_seconds'), self.read_sleepy)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4aadc00bd609294b349cc58ce615678db6…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4aadc00bd609294b349cc58ce615678db6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
e064374e by Philipp Hörist at 2018-01-20T23:51:09+01:00
Update ChangeLog
- - - - -
1 changed file:
- ChangeLog
Changes:
=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+python-nbxmpp 0.6.3 (TBA)
+
+ * Add ALPN and SNI support for when using DirectTLS
+ * Bugfixes
+
python-nbxmpp 0.6.2 (27 December 2017)
* Correctly load client certs
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/e064374efac494e03973fa45f9…
---
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/e064374efac494e03973fa45f9…
You're receiving this email because of your account on dev.gajim.org.