libpurple/purple-client.h

Mon, 12 Sep 2016 08:55:35 -0500

author
Mike Ruprecht <cmaiku@gmail.com>
date
Mon, 12 Sep 2016 08:55:35 -0500
changeset 38142
1dff6e343f9f
parent 34825
91d3e038fa70
child 38057
41f47eb1aa19
permissions
-rw-r--r--

gg: Protect against issues when closing while connecting

Since the GIOStream is cancelled when data is freed, any cancelled
callbacks are called after such data is freed. This patch guards against
cancelled calls by safely returning without accessing any freed data if
the connection has been cancelled (aka closed).

Futhermore, if GG tries to connect and is quickly disconnected,
ggp_tcpsocket_close() is never called. As far as I can tell, it's an
existing bug, but PurpleSockets both work differently when closing and
are closed by the connection if any leak. So the issue wasn't a major
problem. This patch lessens the issue by guarding against it, but it
should be fixed at some point.

#ifndef _PURPLE_CLIENT_H_INCLUDED_
#define _PURPLE_CLIENT_H_INCLUDED_

#include <glib.h>
#include <glib-object.h>
#include "purple-client-bindings.h"

G_BEGIN_DECLS

void purple_init(void);

G_END_DECLS

#endif

mercurial