Mercurial > pidgin
annotate libpurple/protocols/msn/slpmsg_part.c @ 31558:ce968e115c95
propagate from branch 'im.pidgin.cpw.masca.p2p' (head 33ca865dacb9e5bcf763d06f6a42cbaca337cc64)
to branch 'im.pidgin.pidgin' (head 92f47f4e8b0cbb107fd97e1ab814d1cedbf109ad)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 06 May 2011 06:25:14 +0000 |
parents | 8cf9270acf4c |
children | eb1bbaae3427 |
rev | line source |
---|---|
30969
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
1 /** |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
2 * @file slpmsg_part.c MSNSLP Parts |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
3 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
4 * purple |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
5 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
6 * Purple is the legal property of its developers, whose names are too numerous |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
8 * source distribution. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
9 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
13 * (at your option) any later version. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
14 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
18 * GNU General Public License for more details. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
19 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
23 */ |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30947
diff
changeset
|
24 |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
25 #include "internal.h" |
30849
e358e16e527f
Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents:
30847
diff
changeset
|
26 #include "debug.h" |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
27 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
28 #include "slpmsg.h" |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
29 #include "slpmsg_part.h" |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
30 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
31 MsnSlpMessagePart *msn_slpmsgpart_new(MsnP2PInfo *info) |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
32 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
33 MsnSlpMessagePart *part; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
34 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
35 part = g_new0(MsnSlpMessagePart, 1); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
36 |
31319
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
37 part->info = info; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
38 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
39 part->ack_cb = msn_slpmsgpart_ack; |
30822 | 40 part->nak_cb = msn_slpmsgpart_nak; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
41 |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
42 return msn_slpmsgpart_ref(part); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
43 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
44 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
45 MsnSlpMessagePart *msn_slpmsgpart_new_from_data(const char *data, size_t data_len) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
46 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
47 MsnSlpMessagePart *part; |
31319
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
48 MsnP2PInfo *info; |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
49 size_t len; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
50 int body_len; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
51 |
31319
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
52 info = msn_p2p_info_new(MSN_P2P_VERSION_ONE); |
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
53 |
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
54 /* Extract the binary SLP header */ |
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
55 len = msn_p2p_header_from_wire(info, data, data_len); |
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
56 if (len == 0) { |
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
57 msn_p2p_info_free(info); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
58 return NULL; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
59 } |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
60 data += len; |
31319
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31268
diff
changeset
|
61 part = msn_slpmsgpart_new(info); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
62 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
63 /* Extract the body */ |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
64 body_len = data_len - len - P2P_PACKET_FOOTER_SIZE; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
65 /* msg->body_len = msg->msnslp_header.length; */ |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
66 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
67 if (body_len > 0) { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
68 part->size = body_len; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
69 part->buffer = g_malloc(body_len); |
31045
f91501dc406e
Remove extra variables, and this sizeof() is wrong.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31044
diff
changeset
|
70 memcpy(part->buffer, data, body_len); |
f91501dc406e
Remove extra variables, and this sizeof() is wrong.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31044
diff
changeset
|
71 data += body_len; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
72 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
73 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
74 /* Extract the footer */ |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31045
diff
changeset
|
75 if (body_len >= 0) |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
76 msn_p2p_footer_from_wire(part->info, data); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
77 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
78 return part; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
79 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
80 |
31036
05e05d96ba75
Use the unref functions everywhere, instead of destroy. I also removed
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31031
diff
changeset
|
81 static void msn_slpmsgpart_destroy(MsnSlpMessagePart *part) |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
82 { |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
83 g_free(part->info); |
31094
120703c0a0dd
Free the buffer with the SlpMsgPart. Should fix a few leaks from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
84 g_free(part->buffer); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
85 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
86 g_free(part); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
87 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
88 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
89 |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
90 MsnSlpMessagePart *msn_slpmsgpart_ref(MsnSlpMessagePart *part) |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
91 { |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
92 g_return_val_if_fail(part != NULL, NULL); |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
93 part->ref_count++; |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
94 |
30849
e358e16e527f
Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents:
30847
diff
changeset
|
95 if (purple_debug_is_verbose()) |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
96 purple_debug_info("msn", "part ref (%p)[%u]\n", part, part->ref_count); |
30849
e358e16e527f
Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents:
30847
diff
changeset
|
97 |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
98 return part; |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
99 } |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
100 |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
101 void msn_slpmsgpart_unref(MsnSlpMessagePart *part) |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
102 { |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
103 g_return_if_fail(part != NULL); |
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
104 g_return_if_fail(part->ref_count > 0); |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
105 |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
106 part->ref_count--; |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
107 |
30849
e358e16e527f
Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents:
30847
diff
changeset
|
108 if (purple_debug_is_verbose()) |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
109 purple_debug_info("msn", "part unref (%p)[%u]\n", part, part->ref_count); |
30849
e358e16e527f
Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents:
30847
diff
changeset
|
110 |
30847
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
111 if (part->ref_count == 0) { |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
112 msn_slpmsgpart_destroy(part); |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
113 } |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
114 } |
74c4aa38adfc
Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents:
30843
diff
changeset
|
115 |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
116 void msn_slpmsgpart_set_bin_data(MsnSlpMessagePart *part, const void *data, size_t len) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
117 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
118 g_return_if_fail(part != NULL); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
119 |
30935
2de522fa534a
Fix a lot more leaks, some old, some new.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30934
diff
changeset
|
120 g_free(part->buffer); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
121 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
122 if (data != NULL && len > 0) { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
123 part->buffer = g_malloc(len + 1); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
124 memcpy(part->buffer, data, len); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
125 part->buffer[len] = '\0'; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
126 part->size = len; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
127 } else { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
128 part->buffer = NULL; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
129 part->size = 0; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
130 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
131 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
132 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
133 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
134 char *msn_slpmsgpart_serialize(MsnSlpMessagePart *part, size_t *ret_size) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
135 { |
31044
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31037
diff
changeset
|
136 char *header; |
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31037
diff
changeset
|
137 char *footer; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
138 char *base; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
139 char *tmp; |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
140 size_t header_size, footer_size; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
141 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
142 header = msn_p2p_header_to_wire(part->info, &header_size); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
143 footer = msn_p2p_footer_to_wire(part->info, &footer_size); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
144 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
145 base = g_malloc(header_size + part->size + footer_size); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
146 tmp = base; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
147 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
148 /* Copy header */ |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
149 memcpy(tmp, header, header_size); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
150 tmp += header_size; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
151 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
152 /* Copy body */ |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
153 memcpy(tmp, part->buffer, part->size); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
154 tmp += part->size; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
155 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
156 /* Copy footer */ |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
157 memcpy(tmp, footer, footer_size); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
158 tmp += footer_size; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
159 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
160 *ret_size = tmp - base; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
161 |
30934
4e097dfb7784
Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30873
diff
changeset
|
162 g_free(header); |
4e097dfb7784
Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30873
diff
changeset
|
163 g_free(footer); |
4e097dfb7784
Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30873
diff
changeset
|
164 |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
165 return base; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
166 } |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
167 |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
168 /* We have received the message ack */ |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
169 void |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
170 msn_slpmsgpart_ack(MsnSlpMessagePart *part, void *data) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
171 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
172 MsnSlpMessage *slpmsg; |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
173 guint64 offset; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
174 long long real_size; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
175 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
176 slpmsg = data; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
177 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
178 real_size = (msn_p2p_info_get_flags(slpmsg->p2p_info) == P2P_ACK) ? 0 : slpmsg->size; |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
179 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
180 offset = msn_p2p_info_get_offset(slpmsg->p2p_info); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
181 offset += msn_p2p_info_get_length(part->info); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
182 msn_p2p_info_set_offset(slpmsg->p2p_info, offset); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
183 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
184 slpmsg->parts = g_list_remove(slpmsg->parts, part); |
31037
0d5e038911a7
Correct the ref counts on the SlpMsgParts. When it's removed from the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31036
diff
changeset
|
185 msn_slpmsgpart_unref(part); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
186 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
187 if (offset < real_size) |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
188 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
189 if (slpmsg->slpcall->xfer && purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
190 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
191 slpmsg->slpcall->xfer_msg = slpmsg; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
192 purple_xfer_prpl_ready(slpmsg->slpcall->xfer); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
193 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
194 else |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
195 msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
196 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
197 else |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
198 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
199 /* The whole message has been sent */ |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
200 if (msn_p2p_msg_is_data(msn_p2p_info_get_flags(slpmsg->p2p_info))) |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
201 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
202 if (slpmsg->slpcall != NULL) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
203 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
204 if (slpmsg->slpcall->cb) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
205 slpmsg->slpcall->cb(slpmsg->slpcall, |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
206 NULL, 0); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
207 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
208 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
209 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
210 } |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
211 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
212 /* We have received the message nak. */ |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
213 void |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
214 msn_slpmsgpart_nak(MsnSlpMessagePart *part, void *data) |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
215 { |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
216 MsnSlpMessage *slpmsg; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
217 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
218 slpmsg = data; |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
219 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
220 msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
221 |
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
222 slpmsg->parts = g_list_remove(slpmsg->parts, part); |
31037
0d5e038911a7
Correct the ref counts on the SlpMsgParts. When it's removed from the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31036
diff
changeset
|
223 msn_slpmsgpart_unref(part); |
30796
e545b2b6f66a
Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff
changeset
|
224 } |
31031
61db10475bed
As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30969
diff
changeset
|
225 |
31151
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
226 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
227 msn_slpmsgpart_to_string(MsnSlpMessagePart *part, GString *str) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
228 { |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
229 msn_p2p_info_to_string(part->info, str); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
230 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31143
diff
changeset
|
231 |