summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-09-16use TP_SEAL_ENABLEGuillaume Desmottes5-27/+50
https://bugs.freedesktop.org/show_bug.cgi?id=69311
2013-09-16Use TP_DISABLE_SINGLE_INCLUDEGuillaume Desmottes24-67/+18
https://bugs.freedesktop.org/show_bug.cgi?id=69311
2013-09-12connection: use a hash table to store aliasesGuillaume Desmottes1-17/+16
tp_handle_{set,get}_qdata has been deprecated. https://bugs.freedesktop.org/show_bug.cgi?id=64122
2013-09-05ServerConnection: dispose internal objectsLionel Landwerlin1-4/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64923 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-05ServerConnection: kill async read when disconnectingLionel Landwerlin1-1/+9
GSocket creates GSources to provide GInputStream and GOutputStream objects. Interestingly, it doesn't set the GIOCondition on the GSource to handle G_IO_NVAL (ie. your file descriptor is not valid anymore). It means that if your trying to read asynchronously from the socket while someone else closes the socket, you end with an GInputStream that can never complete its asynchronous read operation because the file descriptor isn't valid anymore but that isn't a condition to dispatch the GSource and end the asynchronous read with an error. Alternatively, this wakes up the gmainloop all the time => 100% cpu consumption. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64923 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-11Add handle-name to RoomList propertiesXavier Claessens1-0/+1
Fixes fdo#65614
2013-05-12Don't crash when a channel with multiple requests failsSjoerd Simons1-1/+1
The iteration over the channel requests tokens accidentally used the wrong variable, causing the same request token to be passed into tp-glib all the time causing crashes..
2013-05-01Use slightly more concise g_param_spec_object() argumentsSimon McVittie1-4/+2
I haven't fixed all instances, just the one touched by the interactive TLS code.
2013-05-01Split property/value pairs one-per-line in interactive TLS checking codeSimon McVittie2-3/+10
While we're touching these lines anyway, they might as well be in a slightly more Telepathic style.
2013-05-01ServerConnection: use GSimpleAsyncResult for connect threadWill Thompson1-10/+11
GTask doesn't make the code any smaller, and this way even new Debian stable can have it.
2013-04-30ServerConnection: ensure socket connection is not leakedWill Thompson1-1/+1
If we cancel the connect_async cancellable between the call to g_task_return_pointer (which schedules an idle to call the callback) and Connection calling connect_finish(), the socket_connection would previously have leaked.
2013-04-30ServerConnection: don't leak GTask used to connectWill Thompson1-1/+3
2013-04-30Connection: fix default for 'charset' property.Will Thompson1-1/+1
2013-04-30Connection: cancel connect_async when Disconnect() is calledWill Thompson2-4/+11
2013-04-30Connection: fix a crash on Disconnect() during TLS verificationWill Thompson1-4/+5
Previously, priv->conn was NULL until the TCP session was established, so _iface_shut_down() would take the "no connection yet; call _finish_shutdown_idle_func in an idle" path. But the TLS channel would get closed (because the TLSManager listens for state changes to Disconnected and closes all channels), causing the ServerConnection to call the connect_async() callback and emit ::disconnected, and hence finish shutting down the connection there. Then the idle would crash, because it doesn't take a ref to the connection. We should really cancel the connect_async() call in the new path in _iface_shut_down() to cope with the case where we're still waiting for the TCP connection to be established for some other reason. That, and a test for that, will follow.
2013-04-29Hide IdleServerConnectionStateWill Thompson2-9/+10
2013-04-29Connection: use a boolean for ServerConnection statusWill Thompson1-6/+10
2013-04-29ServerConnection: replace ::status-changed with ::disconnectedWill Thompson2-30/+14
It was already weird that the reason was only used in the disconnected case.
2013-04-29Start pinging & running message queue after 001 (welcome)Will Thompson1-9/+12
Previously, keepalives and unloading messages started as soon as the TCP session is established: before even the PASS/NICK/USER messages have been sent! (IdleServerConnection emits ::status-changed(CONNECTED) before connect_async() finishes.) If a message had got into the queue already, this would break the connection process.
2013-04-29TLSManager: treat unhandled channels as rejected.Will Thompson1-0/+6
This was incorrectly adapted from the Gabble code.
2013-04-28Don't special-case tls handling in testsSjoerd Simons1-10/+0
Don't let the TLS tests accept errors that wouldn't be accepted when idle runs normally, instead implement minimal ServerTLSConnection in the test which need it and add a minimal test for rejecting certificates.
2013-04-28Add support for interactive TLS certificate checkingSjoerd Simons2-2/+93
With the pieces now in place, hook up the TLS channnel manager and pass it to the server connection so it can request interactive certificate checking.
2013-04-28Connect to the server in the non-main threadSjoerd Simons1-3/+21
To do interactive certificate verification with GTls one needs to block in the accept-certificate signal handler, which practically means the connection needs to be done in a seperate check. As a first step, instead using _connect_to_host_async in the main thread use a GTask to synchronously connect in a different thread instead.
2013-04-28Port to TLS handling code to work in IdleSjoerd Simons7-221/+105
Instead of server-tls-manager being a Wocky TLS manager add async API to start the certificate verification on request and use a GTlsCertificate to get the needed certificate information instead of WockyTLSsession.
2013-04-28Copy TLS channel code from gabbleSjoerd Simons6-0/+1448
Take the TLS channel handling code from Gabble and s/gabble/idle in the various files, but no other changes
2013-04-24IdleServerConnection: check certificates properly, except in the testsSimon McVittie1-5/+10
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63810 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-04-24Include config.h in each source fileSimon McVittie10-0/+11
Among other effects, this makes GLIB_VERSION_MIN_REQUIRED effective. Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2013-04-22Drop unused build dependency on OpenSSLWill Thompson1-2/+0
Since some time ago, Idle has used GIO's TLS stuff; we should have dropped this back then. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-11-16Parse PONG more lenientlyWill Thompson1-1/+1
2012-11-14muc-channel: remove content-free/wrong docstringsWill Thompson1-24/+1
2012-11-14muc-channel: implement Destroy(), make Close() respawnWill Thompson2-3/+50
This fixes the issue where empathy-chat crashing means you get kicked out of all your channels. It's technically backwards-incompatible but empathy-chat has been using RemoveMembers() to leave rooms for ages, and it's a pretty destructive and annoying bug, so let's just get on with it. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24614
2012-11-09muc-channel: implement get_interfaces vfuncWill Thompson1-1/+15
I don't think this new API is a net improvement over making TpBaseChannel do the work of merging ->interfaces (which would involve zero code changes in CMs, and none of this stupid boilerplate for building a list of strings in every CM) but there we go.
2012-11-09im-channel: chain up in get_interfaces() implWill Thompson1-1/+3
This is a no-op right now, but it's the right thing to do.
2012-11-09im-manager: use tp_base_channel_is_destroyed()Will Thompson1-8/+3
This is equivalent but neater.
2012-11-02Merge branch 'ping'Will Thompson6-50/+143
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=56589
2012-11-02Clarify ping timeout comparisonWill Thompson1-1/+2
Jonny wanted this to be clearer on <https://bugs.freedesktop.org/show_bug.cgi?id=56589#c1>.
2012-10-30connection: cope with send_async() returning synchronouslyWill Thompson1-1/+1
On <https://bugs.freedesktop.org/show_bug.cgi?id=49163>, Alban Browaeys described a situation where idle_server_connection_send_async() would call its callback synchronously, due to a bug in GLib. While I think that bug is fixed, we can be more defensive against this by initializing priv->msg_sending to TRUE before calling idle_server_connection_send_async() rather than after. That way, if the _msg_queue_timeout_ready() callback is called synchronously (due to a bug), Idle won't get stuck thinking it's sending a message.
2012-10-30Disable keepalive pings if server doesn't support PING.Will Thompson3-0/+21
I don't know which servers don't support PING, but irssi does this, so I figure we may as well do it too. I tested this by making Idle send and check for PNNING, which Freenode doesn't support. It's not obvious how to write a good automated test for this.
2012-10-30Fix _force_disconnect to actually forcibly disconnect.Will Thompson3-14/+22
Previously, if the network connection had gone away _force_disconnect() would not actually make the connection die any faster, because g_io_stream_close_async() waits for a reply by default. But by pulling the same trick with a cancelled cancellable as is used for ping timeouts, we can fix this. I tested this by: * Connecting to a server (with keepalive-interval=0 to ensure that doesn't interfere). * Pulling out my network cable (breaking the connection) but leaving my wireless connection up. * calling Disconnect() on the connection. Before, the connection would never finish disconnecting; after, the _force_disconnect() timeout actually does something useful and the connection dies properly.
2012-10-30Don't try to ping while we're disconnecting.Will Thompson1-1/+2
2012-10-30Connection: disconnect if we get no PONG for our PINGWill Thompson3-3/+59
Previously we'd just send out a PING into the æther every n seconds, and pay no attention to whether we ever got an answer. So it was perfectly possible for the connection to just sit there until the TCP timeout kicks in, which I think is a matter of hours by default. With this patch, if we haven't heard a PONG 3 keepalive-intervals after sending a PING, Idle throws its toys out of the pram. This has been tested as follows: * Put my laptop on a wired and wireless network simultaneously. * Connect to an IRC server. (The wired network is used.) * Pull the network cable out. Idle is too stupid to realise the link it was using is gone, and because we're still ostensibly online, nothing tells it to disconnect. * Wait keepalive-interval * 4, and watch the connection get disconnected. It works both with a direct connection to Freenode, and with a connection over an SSH tunnel to irssi-proxy.
2012-10-30Move comment about message interval to the right placeWill Thompson1-3/+2
2012-10-30Connection: add priv field to structureWill Thompson2-40/+45
2012-10-30Parser: spell out prefix vs. non-prefix logic betterWill Thompson2-2/+4
2012-10-30RoomlistManager: remove redundant check for HandleWill Thompson1-11/+0
tp_channel_manager_asv_has_unknown_properties() takes care of excluding extra properties for us.
2012-10-30Add a debug flag for roomlist code.Will Thompson3-4/+3
2012-10-29Fix warnings in roomlist code.Will Thompson2-14/+13
Whoops.
2012-10-29idle_roomlist_manager_get_type: fix prototypeWill Thompson1-1/+1
2012-10-29Merge branch 'room-list'Will Thompson8-0/+988
2012-10-29Sanitize incoming messages to remove UTF-8 non-characters.Will Thompson1-0/+41
https://bugs.freedesktop.org/show_bug.cgi?id=30741