author | Frank Zschockelt <lm@freakysoft.de> |
Thu, 04 Feb 2016 19:18:03 +0100 | |
changeset 690 | 7ccf2113ec5f |
parent 624 | a94013a4555d |
child 725 | 05fa3e01e5b1 |
permissions | -rw-r--r-- |
516
4dd3aa6b83e5
Change the tab width to 4 steps in the emacs headers
Mikael Hallendal <micke@imendio.com>
parents:
515
diff
changeset
|
1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
2 |
/* |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
3 |
* Copyright (C) 2008 Imendio AB |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
4 |
* |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
6 |
* modify it under the terms of the GNU Lesser General Public License as |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; either version 2 of the |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
8 |
* License, or (at your option) any later version. |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
9 |
* |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
13 |
* Lesser General Public License for more details. |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
14 |
* |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU Lesser General Public |
690
7ccf2113ec5f
Update the postal address of the FSF
Frank Zschockelt <lm@freakysoft.de>
parents:
624
diff
changeset
|
16 |
* License along with this program; if not, see <https://www.gnu.org/licenses> |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
17 |
*/ |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
18 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
19 |
#include <config.h> |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
20 |
|
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
21 |
#include "lm-connection.h" |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
22 |
#include "lm-debug.h" |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
23 |
#include "lm-internals.h" |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
24 |
#include "lm-marshal.h" |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
25 |
#include "lm-misc.h" |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
26 |
|
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
27 |
#include "lm-feature-ping.h" |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
28 |
|
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
29 |
#define XMPP_NS_PING "urn:xmpp:ping" |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
30 |
|
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
31 |
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), LM_TYPE_FEATURE_PING, LmFeaturePingPriv)) |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
32 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
33 |
typedef struct LmFeaturePingPriv LmFeaturePingPriv; |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
34 |
struct LmFeaturePingPriv { |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
35 |
LmConnection *connection; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
36 |
guint keep_alive_rate; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
37 |
GSource *keep_alive_source; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
38 |
guint keep_alive_counter; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
39 |
}; |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
40 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
41 |
static void feature_ping_finalize (GObject *object); |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
42 |
static void feature_ping_get_property (GObject *object, |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
43 |
guint param_id, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
44 |
GValue *value, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
45 |
GParamSpec *pspec); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
46 |
static void feature_ping_set_property (GObject *object, |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
47 |
guint param_id, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
48 |
const GValue *value, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
49 |
GParamSpec *pspec); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
50 |
|
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
51 |
static LmHandlerResult |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
52 |
feature_ping_keep_alive_reply (LmMessageHandler *handler, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
53 |
LmConnection *connection, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
54 |
LmMessage *m, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
55 |
gpointer user_data); |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
56 |
static gboolean feature_ping_send_keep_alive (LmFeaturePing *fp); |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
57 |
|
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
58 |
G_DEFINE_TYPE (LmFeaturePing, lm_feature_ping, G_TYPE_OBJECT) |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
59 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
60 |
enum { |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
61 |
PROP_0, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
62 |
PROP_CONNECTION, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
63 |
PROP_RATE |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
64 |
}; |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
65 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
66 |
enum { |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
67 |
TIMED_OUT, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
68 |
LAST_SIGNAL |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
69 |
}; |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
70 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
71 |
static guint signals[LAST_SIGNAL] = { 0 }; |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
72 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
73 |
static void |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
74 |
lm_feature_ping_class_init (LmFeaturePingClass *class) |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
75 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
76 |
GObjectClass *object_class = G_OBJECT_CLASS (class); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
77 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
78 |
object_class->finalize = feature_ping_finalize; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
79 |
object_class->get_property = feature_ping_get_property; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
80 |
object_class->set_property = feature_ping_set_property; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
81 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
82 |
g_object_class_install_property (object_class, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
83 |
PROP_CONNECTION, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
84 |
g_param_spec_pointer ("connection", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
85 |
"Connection", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
86 |
"The LmConnection to use", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
87 |
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
88 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
89 |
g_object_class_install_property (object_class, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
90 |
PROP_RATE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
91 |
g_param_spec_uint ("rate", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
92 |
"Timeout Rate", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
93 |
"Keep alive rate in seconds", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
94 |
0, G_MAXUINT, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
95 |
0, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
96 |
G_PARAM_READWRITE)); |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
97 |
|
607 | 98 |
signals[TIMED_OUT] = |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
99 |
g_signal_new ("timed-out", |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
100 |
G_OBJECT_CLASS_TYPE (object_class), |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
101 |
G_SIGNAL_RUN_LAST, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
102 |
0, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
103 |
NULL, NULL, |
521
50294ce6587e
Updated the build system to use a build directory and a common marshal Makefile.
Mikael Hallendal <micke@imendio.com>
parents:
518
diff
changeset
|
104 |
_lm_marshal_VOID__VOID, |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
105 |
G_TYPE_NONE, 0); |
607 | 106 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
107 |
g_type_class_add_private (object_class, sizeof (LmFeaturePingPriv)); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
108 |
} |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
109 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
110 |
static void |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
111 |
lm_feature_ping_init (LmFeaturePing *feature_ping) |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
112 |
{ |
624 | 113 |
(void) GET_PRIV (feature_ping); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
114 |
} |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
115 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
116 |
static void |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
117 |
feature_ping_finalize (GObject *object) |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
118 |
{ |
624 | 119 |
(void) GET_PRIV (object); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
120 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
121 |
(G_OBJECT_CLASS (lm_feature_ping_parent_class)->finalize) (object); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
122 |
} |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
123 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
124 |
static void |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
125 |
feature_ping_get_property (GObject *object, |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
126 |
guint param_id, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
127 |
GValue *value, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
128 |
GParamSpec *pspec) |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
129 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
130 |
LmFeaturePingPriv *priv; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
131 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
132 |
priv = GET_PRIV (object); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
133 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
134 |
switch (param_id) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
135 |
case PROP_RATE: |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
136 |
g_value_set_uint (value, priv->keep_alive_rate); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
137 |
break; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
138 |
default: |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
139 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
140 |
break; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
141 |
}; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
142 |
} |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
143 |
|
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
144 |
static void |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
145 |
feature_ping_set_property (GObject *object, |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
146 |
guint param_id, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
147 |
const GValue *value, |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
148 |
GParamSpec *pspec) |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
149 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
150 |
LmFeaturePingPriv *priv; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
151 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
152 |
priv = GET_PRIV (object); |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
153 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
154 |
switch (param_id) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
155 |
case PROP_CONNECTION: |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
156 |
priv->connection = g_value_get_pointer (value); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
157 |
break; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
158 |
case PROP_RATE: |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
159 |
priv->keep_alive_rate = g_value_get_uint (value); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
160 |
/* Restart the pings */ |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
161 |
break; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
162 |
default: |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
163 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
164 |
break; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
165 |
}; |
505
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
166 |
} |
ba6f96b3e4a8
Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
167 |
|
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
168 |
static LmHandlerResult |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
169 |
feature_ping_keep_alive_reply (LmMessageHandler *handler, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
170 |
LmConnection *connection, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
171 |
LmMessage *m, |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
172 |
gpointer user_data) |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
173 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
174 |
LmFeaturePingPriv *priv; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
175 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
176 |
priv = GET_PRIV (user_data); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
177 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
178 |
priv->keep_alive_counter = 0; |
607 | 179 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
180 |
return LM_HANDLER_RESULT_REMOVE_MESSAGE; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
181 |
} |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
182 |
|
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
183 |
static gboolean |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
184 |
feature_ping_send_keep_alive (LmFeaturePing *fp) |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
185 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
186 |
LmFeaturePingPriv *priv; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
187 |
LmMessage *ping; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
188 |
LmMessageNode *ping_node; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
189 |
LmMessageHandler *keep_alive_handler; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
190 |
gchar *server; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
191 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
192 |
priv = GET_PRIV (fp); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
193 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
194 |
priv->keep_alive_counter++; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
195 |
if (priv->keep_alive_counter > 3) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
196 |
g_signal_emit (fp, signals[TIMED_OUT], 0); |
621
2313363bd272
Give up unneeded ping request on connection timeout
Hermitifier <quantifier666@gmail.com>
parents:
607
diff
changeset
|
197 |
return FALSE; |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
198 |
/* FIXME */ |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
199 |
#if 0 /* Should be moved to signal callback in LmConnection */ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
200 |
connection_do_close (connection); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
201 |
connection_signal_disconnect (connection, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
202 |
LM_DISCONNECT_REASON_PING_TIME_OUT); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
203 |
#endif |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
204 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
205 |
} |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
206 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
207 |
server = _lm_connection_get_server (priv->connection); |
607 | 208 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
209 |
ping = lm_message_new_with_sub_type (server, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
210 |
LM_MESSAGE_TYPE_IQ, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
211 |
LM_MESSAGE_SUB_TYPE_GET); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
212 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
213 |
ping_node = lm_message_node_add_child (ping->node, "ping", NULL); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
214 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
215 |
lm_message_node_set_attribute (ping_node, "xmlns", XMPP_NS_PING); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
216 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
217 |
keep_alive_handler = |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
218 |
lm_message_handler_new (feature_ping_keep_alive_reply, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
219 |
fp, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
220 |
FALSE); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
221 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
222 |
if (!lm_connection_send_with_reply (priv->connection, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
223 |
ping, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
224 |
keep_alive_handler, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
225 |
NULL)) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
226 |
lm_verbose ("Error while sending XMPP ping!\n"); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
227 |
} |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
228 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
229 |
lm_message_handler_unref (keep_alive_handler); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
230 |
lm_message_unref (ping); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
231 |
g_free (server); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
232 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
233 |
return TRUE; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
234 |
} |
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
235 |
|
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
236 |
|
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
237 |
void |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
238 |
lm_feature_ping_start (LmFeaturePing *fp) |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
239 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
240 |
LmFeaturePingPriv *priv; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
241 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
242 |
g_return_if_fail (LM_IS_FEATURE_PING (fp)); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
243 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
244 |
priv = GET_PRIV (fp); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
245 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
246 |
if (priv->keep_alive_source) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
247 |
lm_feature_ping_stop (fp); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
248 |
} |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
249 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
250 |
if (priv->keep_alive_rate > 0) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
251 |
priv->keep_alive_counter = 0; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
252 |
priv->keep_alive_source = |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
253 |
lm_misc_add_timeout (_lm_connection_get_context (priv->connection), |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
254 |
priv->keep_alive_rate * 1000, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
255 |
(GSourceFunc) feature_ping_send_keep_alive, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
256 |
fp); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
257 |
} |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
258 |
} |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
259 |
|
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
260 |
void |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
261 |
lm_feature_ping_stop (LmFeaturePing *fp) |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
262 |
{ |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
263 |
LmFeaturePingPriv *priv; |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
264 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
265 |
g_return_if_fail (LM_IS_FEATURE_PING (fp)); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
266 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
267 |
priv = GET_PRIV (fp); |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
268 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
269 |
if (priv->keep_alive_source) { |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
270 |
g_source_destroy (priv->keep_alive_source); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
271 |
} |
507
06e7b24dbcb3
Added the code from LmConnection to send and receive the XMPP Ping to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
506
diff
changeset
|
272 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
273 |
priv->keep_alive_source = NULL; |
506
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
274 |
} |
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
275 |
|
9d9be7000667
Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents:
505
diff
changeset
|
276 |