Sun, 06 Jan 2008 19:45:03 +0000
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
transfer support. Currently sending multiple files from an official Yahoo
client is treated as multiple individual transfers that must be accepted
separately. This also changes things so that we identify as Yahoo Messenger
version 8.0 (previously we were identifying as 6.0 or not at all).
Refs #708. Refs #4533
committer: John Bailey <rekkanoryo@rekkanoryo.org>
| 7651 | 1 | /* |
| 2 | * @file yahoo_filexfer.c Yahoo Filetransfer | |
| 3 | * | |
| 15884 | 4 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7651 | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19064
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7651 | 21 | */ |
| 22 | ||
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
23 | #include "internal.h" |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
24 | #include "dnsquery.h" |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
25 | |
| 7651 | 26 | #include "prpl.h" |
| 27 | #include "util.h" | |
| 28 | #include "debug.h" | |
| 29 | #include "notify.h" | |
| 30 | #include "proxy.h" | |
| 31 | #include "ft.h" | |
| 32 | #include "yahoo.h" | |
| 10392 | 33 | #include "yahoo_packet.h" |
| 7651 | 34 | #include "yahoo_filexfer.h" |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
35 | #include "yahoo_doodle.h" |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
36 | #include "yahoo_friend.h" |
| 7651 | 37 | |
| 38 | struct yahoo_xfer_data { | |
| 39 | gchar *host; | |
| 40 | gchar *path; | |
| 41 | int port; | |
| 15884 | 42 | PurpleConnection *gc; |
| 7651 | 43 | long expires; |
| 44 | gboolean started; | |
|
13272
fd4f3356640f
[gaim-migrate @ 15637]
Daniel Atallah <datallah@pidgin.im>
parents:
13201
diff
changeset
|
45 | gchar *txbuf; |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
46 | gsize txbuflen; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
47 | gsize txbuf_written; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
48 | guint tx_handler; |
| 7651 | 49 | gchar *rxqueue; |
| 50 | guint rxlen; | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
51 | gchar *xfer_idstring_between_peers; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
52 | gchar *xfer_idstring_for_relay; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
53 | int version; /*0 for old, 15 for Y7(YMSG 15)*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
54 | int info_val_249; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
55 | enum {STARTED = 0,HEAD_REQUESTED,HEAD_REPLY_RECEIVED,TRANSFER_PHASE,ACCEPTED} status_15; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
56 | GSList *filename_list;/*contains all filenames, in case of multiple transfers, with the first one in the list being the current(ymsg15)*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
57 | GSList *size_list;/*corresponds to filename_list, with size as **STRING** */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
58 | gboolean firstoflist; |
| 7651 | 59 | }; |
| 60 | ||
| 61 | static void yahoo_xfer_data_free(struct yahoo_xfer_data *xd) | |
| 62 | { | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
63 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
64 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
65 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
66 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
67 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
68 | gc = xd->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
69 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
70 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
71 | /*remove entry from map*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
72 | if(xd->xfer_idstring_between_peers) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
73 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xd->xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
74 | if(xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
75 | g_hash_table_remove(yd->xfer_peer_idstring_map, xd->xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
76 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
77 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
78 | /*empty file & filesize list*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
79 | for (l = xd->filename_list; l; l = l->next) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
80 | g_free(l->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
81 | l->data=NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
82 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
83 | for (l = xd->size_list; l; l = l->next) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
84 | g_free(l->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
85 | l->data=NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
86 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
87 | g_slist_free(xd->filename_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
88 | g_slist_free(xd->size_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
89 | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
90 | g_free(xd->host); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
91 | g_free(xd->path); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
92 | g_free(xd->txbuf); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
93 | g_free(xd->xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
94 | g_free(xd->xfer_idstring_for_relay); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
95 | if (xd->tx_handler) |
| 15884 | 96 | purple_input_remove(xd->tx_handler); |
| 7651 | 97 | g_free(xd); |
| 98 | } | |
| 99 | ||
| 15884 | 100 | static void yahoo_receivefile_send_cb(gpointer data, gint source, PurpleInputCondition condition) |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
101 | { |
| 15884 | 102 | PurpleXfer *xfer; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
103 | struct yahoo_xfer_data *xd; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
104 | int remaining, written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
105 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
106 | xfer = data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
107 | xd = xfer->data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
108 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
109 | remaining = xd->txbuflen - xd->txbuf_written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
110 | written = write(xfer->fd, xd->txbuf + xd->txbuf_written, remaining); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
111 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
112 | if (written < 0 && errno == EAGAIN) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
113 | written = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
114 | else if (written <= 0) { |
| 15884 | 115 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
| 116 | purple_xfer_cancel_remote(xfer); | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
117 | return; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
118 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
119 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
120 | if (written < remaining) { |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
121 | xd->txbuf_written += written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
122 | return; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
123 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
124 | |
| 15884 | 125 | purple_input_remove(xd->tx_handler); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
126 | xd->tx_handler = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
127 | g_free(xd->txbuf); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
128 | xd->txbuf = NULL; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
129 | xd->txbuflen = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
130 | |
| 15884 | 131 | purple_xfer_start(xfer, source, NULL, 0); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
132 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
133 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
134 | |
|
14182
517f4531b8a0
[gaim-migrate @ 16754]
Mark Doliner <markdoliner@pidgin.im>
parents:
14170
diff
changeset
|
135 | static void yahoo_receivefile_connected(gpointer data, gint source, const gchar *error_message) |
| 7651 | 136 | { |
| 15884 | 137 | PurpleXfer *xfer; |
| 7651 | 138 | struct yahoo_xfer_data *xd; |
| 139 | ||
| 15884 | 140 | purple_debug(PURPLE_DEBUG_INFO, "yahoo", |
| 7651 | 141 | "AAA - in yahoo_receivefile_connected\n"); |
| 142 | if (!(xfer = data)) | |
| 143 | return; | |
| 144 | if (!(xd = xfer->data)) | |
| 145 | return; | |
|
13144
e8c3eafab5f8
[gaim-migrate @ 15506]
Evan Schoenberg <evands@pidgin.im>
parents:
12412
diff
changeset
|
146 | if ((source < 0) || (xd->path == NULL) || (xd->host == NULL)) { |
| 15884 | 147 | purple_xfer_error(PURPLE_XFER_RECEIVE, purple_xfer_get_account(xfer), |
|
10654
b2dd3be1b087
[gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents:
10651
diff
changeset
|
148 | xfer->who, _("Unable to connect.")); |
| 15884 | 149 | purple_xfer_cancel_remote(xfer); |
| 7651 | 150 | return; |
| 151 | } | |
| 152 | ||
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
153 | xfer->fd = source; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
154 | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
155 | /* The first time we get here, assemble the tx buffer */ |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
156 | if (xd->txbuflen == 0) { |
|
22201
434114a12ae4
Revert patch that added receive-only transfer support for Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21918
diff
changeset
|
157 | xd->txbuf = g_strdup_printf("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n", |
|
434114a12ae4
Revert patch that added receive-only transfer support for Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21918
diff
changeset
|
158 | xd->path, xd->host); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
159 | xd->txbuflen = strlen(xd->txbuf); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
160 | xd->txbuf_written = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
161 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
162 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
163 | if (!xd->tx_handler) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
164 | { |
| 15884 | 165 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
166 | yahoo_receivefile_send_cb, xfer); |
| 15884 | 167 | yahoo_receivefile_send_cb(xfer, source, PURPLE_INPUT_WRITE); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
168 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
169 | } |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
170 | |
| 15884 | 171 | static void yahoo_sendfile_send_cb(gpointer data, gint source, PurpleInputCondition condition) |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
172 | { |
| 15884 | 173 | PurpleXfer *xfer; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
174 | struct yahoo_xfer_data *xd; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
175 | int written, remaining; |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
176 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
177 | xfer = data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
178 | xd = xfer->data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
179 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
180 | remaining = xd->txbuflen - xd->txbuf_written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
181 | written = write(xfer->fd, xd->txbuf + xd->txbuf_written, remaining); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
182 | |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
183 | if (written < 0 && errno == EAGAIN) |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
184 | written = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
185 | else if (written <= 0) { |
| 15884 | 186 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
| 187 | purple_xfer_cancel_remote(xfer); | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
188 | return; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
189 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
190 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
191 | if (written < remaining) { |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
192 | xd->txbuf_written += written; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
193 | return; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
194 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
195 | |
| 15884 | 196 | purple_input_remove(xd->tx_handler); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
197 | xd->tx_handler = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
198 | g_free(xd->txbuf); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
199 | xd->txbuf = NULL; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
200 | xd->txbuflen = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
201 | |
| 15884 | 202 | purple_xfer_start(xfer, source, NULL, 0); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
203 | } |
| 7651 | 204 | |
|
14182
517f4531b8a0
[gaim-migrate @ 16754]
Mark Doliner <markdoliner@pidgin.im>
parents:
14170
diff
changeset
|
205 | static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) |
| 7651 | 206 | { |
| 15884 | 207 | PurpleXfer *xfer; |
| 7651 | 208 | struct yahoo_xfer_data *xd; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
209 | struct yahoo_packet *pkt; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
210 | gchar *size, *filename, *encoded_filename, *header; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
211 | guchar *pkt_buf; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
212 | const char *host; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
213 | int port; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
214 | size_t content_length, header_len, pkt_buf_len; |
| 15884 | 215 | PurpleConnection *gc; |
| 216 | PurpleAccount *account; | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
217 | struct yahoo_data *yd; |
| 7651 | 218 | |
| 15884 | 219 | purple_debug(PURPLE_DEBUG_INFO, "yahoo", |
| 7651 | 220 | "AAA - in yahoo_sendfile_connected\n"); |
| 221 | if (!(xfer = data)) | |
| 222 | return; | |
| 223 | if (!(xd = xfer->data)) | |
| 224 | return; | |
| 225 | ||
| 226 | if (source < 0) { | |
| 15884 | 227 | purple_xfer_error(PURPLE_XFER_RECEIVE, purple_xfer_get_account(xfer), |
|
10654
b2dd3be1b087
[gaim-migrate @ 12182]
Richard Laager <rlaager@pidgin.im>
parents:
10651
diff
changeset
|
228 | xfer->who, _("Unable to connect.")); |
| 15884 | 229 | purple_xfer_cancel_remote(xfer); |
| 7651 | 230 | return; |
| 231 | } | |
| 232 | ||
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
233 | xfer->fd = source; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
234 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
235 | /* Assemble the tx buffer */ |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
236 | gc = xd->gc; |
| 15884 | 237 | account = purple_connection_get_account(gc); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
238 | yd = gc->proto_data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
239 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
240 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
241 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
| 7651 | 242 | |
| 15884 | 243 | size = g_strdup_printf("%" G_GSIZE_FORMAT, purple_xfer_get_size(xfer)); |
| 244 | filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
245 | encoded_filename = yahoo_string_encode(gc, filename, NULL); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
246 | |
| 15884 | 247 | yahoo_packet_hash(pkt, "sssss", 0, purple_connection_get_display_name(gc), |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
248 | 5, xfer->who, 14, "", 27, encoded_filename, 28, size); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
249 | g_free(size); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
250 | g_free(encoded_filename); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
251 | g_free(filename); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
252 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
253 | content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
254 | |
|
14508
02d80a119d80
[gaim-migrate @ 17160]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
255 | pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
256 | yahoo_packet_free(pkt); |
| 7651 | 257 | |
| 15884 | 258 | host = purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST); |
| 259 | port = purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT); | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
260 | header = g_strdup_printf( |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
261 | "POST http://%s:%d/notifyft HTTP/1.0\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
262 | "Content-length: %" G_GSIZE_FORMAT "\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
263 | "Host: %s:%d\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
264 | "Cookie: Y=%s; T=%s\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
265 | "\r\n", |
| 15884 | 266 | host, port, content_length + 4 + purple_xfer_get_size(xfer), |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
267 | host, port, yd->cookie_y, yd->cookie_t); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
268 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
269 | header_len = strlen(header); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
270 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
271 | xd->txbuflen = header_len + pkt_buf_len + 4; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
272 | xd->txbuf = g_malloc(xd->txbuflen); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
273 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
274 | memcpy(xd->txbuf, header, header_len); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
275 | g_free(header); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
276 | memcpy(xd->txbuf + header_len, pkt_buf, pkt_buf_len); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
277 | g_free(pkt_buf); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
278 | memcpy(xd->txbuf + header_len + pkt_buf_len, "29\xc0\x80", 4); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
279 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
280 | xd->txbuf_written = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
281 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
282 | if (xd->tx_handler == 0) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
283 | { |
| 15884 | 284 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
285 | yahoo_sendfile_send_cb, xfer); |
| 15884 | 286 | yahoo_sendfile_send_cb(xfer, source, PURPLE_INPUT_WRITE); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
287 | } |
| 7651 | 288 | } |
| 289 | ||
| 15884 | 290 | static void yahoo_xfer_init(PurpleXfer *xfer) |
| 7651 | 291 | { |
| 292 | struct yahoo_xfer_data *xfer_data; | |
| 15884 | 293 | PurpleConnection *gc; |
| 294 | PurpleAccount *account; | |
| 7827 | 295 | struct yahoo_data *yd; |
| 7651 | 296 | |
| 297 | xfer_data = xfer->data; | |
| 298 | gc = xfer_data->gc; | |
| 7827 | 299 | yd = gc->proto_data; |
| 15884 | 300 | account = purple_connection_get_account(gc); |
| 7651 | 301 | |
| 15884 | 302 | if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) { |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
303 | if (yd->jp) { |
| 15884 | 304 | if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), |
| 305 | purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), | |
|
14170
f611621bc8a0
[gaim-migrate @ 16742]
Mark Doliner <markdoliner@pidgin.im>
parents:
14151
diff
changeset
|
306 | yahoo_sendfile_connected, xfer) == NULL) |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
307 | { |
| 15884 | 308 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
309 | _("Unable to establish file descriptor.")); |
| 15884 | 310 | purple_xfer_cancel_remote(xfer); |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
311 | } |
| 8282 | 312 | } else { |
| 15884 | 313 | if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), |
| 314 | purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), | |
|
14170
f611621bc8a0
[gaim-migrate @ 16742]
Mark Doliner <markdoliner@pidgin.im>
parents:
14151
diff
changeset
|
315 | yahoo_sendfile_connected, xfer) == NULL) |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
316 | { |
| 15884 | 317 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
318 | _("Unable to establish file descriptor.")); |
| 15884 | 319 | purple_xfer_cancel_remote(xfer); |
| 8282 | 320 | } |
| 7651 | 321 | } |
| 322 | } else { | |
|
20044
2b66cf7c7266
grab revision 24d76e86b06c5b1ab5f0a3ea37bd69ced034e0d0 (Reset file descriptors to -1 instead of 0 to fix some weird unexpected crashes in finch
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
323 | xfer->fd = -1; |
| 15884 | 324 | if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port, |
|
20044
2b66cf7c7266
grab revision 24d76e86b06c5b1ab5f0a3ea37bd69ced034e0d0 (Reset file descriptors to -1 instead of 0 to fix some weird unexpected crashes in finch
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
325 | yahoo_receivefile_connected, xfer) == NULL) { |
| 15884 | 326 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
| 7651 | 327 | _("Unable to establish file descriptor.")); |
| 15884 | 328 | purple_xfer_cancel_remote(xfer); |
| 7651 | 329 | } |
| 330 | } | |
| 331 | } | |
| 332 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
333 | static void yahoo_xfer_init_15(PurpleXfer *xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
334 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
335 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
336 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
337 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
338 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
339 | struct yahoo_packet *pkt; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
340 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
341 | xfer_data = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
342 | gc = xfer_data->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
343 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
344 | account = purple_connection_get_account(gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
345 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
346 | if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
347 | gchar *filename; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
348 | filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
349 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
350 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
351 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
352 | yahoo_packet_hash(pkt, "sssiiiisiii", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
353 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
354 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
355 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
356 | 222, 1, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
357 | 266, 1, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
358 | 302, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
359 | 300, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
360 | 27, filename, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
361 | 28, xfer->size, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
362 | 301, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
363 | 303, 268); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
364 | g_free(filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
365 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
366 | if(xfer_data->firstoflist == TRUE) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
367 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
368 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
369 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
370 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
371 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
372 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
373 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
374 | 222, 3); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
375 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
376 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_ACC_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
377 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
378 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
379 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
380 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
381 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
382 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
383 | 271, 1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
384 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
385 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
386 | yahoo_packet_send_and_free(pkt, yd); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
387 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
388 | |
| 15884 | 389 | static void yahoo_xfer_start(PurpleXfer *xfer) |
| 7651 | 390 | { |
| 391 | /* We don't need to do anything here, do we? */ | |
| 392 | } | |
| 393 | ||
|
11897
10853b830964
[gaim-migrate @ 14188]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11801
diff
changeset
|
394 | static guint calculate_length(const gchar *l, size_t len) |
| 7651 | 395 | { |
| 396 | int i; | |
| 397 | ||
| 398 | for (i = 0; i < len; i++) { | |
| 399 | if (!g_ascii_isdigit(l[i])) | |
| 400 | continue; | |
| 401 | return strtol(l + i, NULL, 10); | |
| 402 | } | |
| 403 | return 0; | |
| 404 | } | |
| 405 | ||
| 15884 | 406 | static gssize yahoo_xfer_read(guchar **buffer, PurpleXfer *xfer) |
| 7651 | 407 | { |
| 7710 | 408 | gchar buf[4096]; |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12143
diff
changeset
|
409 | gssize len; |
| 7651 | 410 | gchar *start = NULL; |
| 411 | gchar *length; | |
| 412 | gchar *end; | |
| 7710 | 413 | int filelen; |
| 7651 | 414 | struct yahoo_xfer_data *xd = xfer->data; |
| 415 | ||
| 15884 | 416 | if (purple_xfer_get_type(xfer) != PURPLE_XFER_RECEIVE) { |
| 7651 | 417 | return 0; |
| 418 | } | |
| 419 | ||
| 420 | len = read(xfer->fd, buf, sizeof(buf)); | |
| 421 | ||
| 7682 | 422 | if (len <= 0) { |
| 15884 | 423 | if ((purple_xfer_get_size(xfer) > 0) && |
| 424 | (purple_xfer_get_bytes_sent(xfer) >= purple_xfer_get_size(xfer))) { | |
| 425 | purple_xfer_set_completed(xfer, TRUE); | |
| 9798 | 426 | return 0; |
| 427 | } else | |
| 428 | return -1; | |
| 7651 | 429 | } |
| 430 | ||
| 431 | if (!xd->started) { | |
| 432 | xd->rxqueue = g_realloc(xd->rxqueue, len + xd->rxlen); | |
| 433 | memcpy(xd->rxqueue + xd->rxlen, buf, len); | |
| 434 | xd->rxlen += len; | |
| 435 | ||
| 436 | length = g_strstr_len(xd->rxqueue, len, "Content-length:"); | |
|
10579
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
437 | /* some proxies re-write this header, changing the capitalization :( |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
438 | * technically that's allowed since headers are case-insensitive |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
439 | * [RFC 2616, section 4.2] */ |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
440 | if (length == NULL) |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
441 | length = g_strstr_len(xd->rxqueue, len, "Content-Length:"); |
| 7651 | 442 | if (length) { |
| 443 | end = g_strstr_len(length, length - xd->rxqueue, "\r\n"); | |
| 444 | if (!end) | |
| 445 | return 0; | |
| 7710 | 446 | if ((filelen = calculate_length(length, len - (length - xd->rxqueue)))) |
| 15884 | 447 | purple_xfer_set_size(xfer, filelen); |
| 7651 | 448 | } |
| 449 | start = g_strstr_len(xd->rxqueue, len, "\r\n\r\n"); | |
| 450 | if (start) | |
| 451 | start += 4; | |
| 452 | if (!start || start > (xd->rxqueue + len)) | |
| 453 | return 0; | |
| 454 | xd->started = TRUE; | |
| 455 | ||
| 456 | len -= (start - xd->rxqueue); | |
| 457 | ||
| 458 | *buffer = g_malloc(len); | |
| 459 | memcpy(*buffer, start, len); | |
| 460 | g_free(xd->rxqueue); | |
| 461 | xd->rxqueue = NULL; | |
| 462 | xd->rxlen = 0; | |
| 463 | } else { | |
| 464 | *buffer = g_malloc(len); | |
| 465 | memcpy(*buffer, buf, len); | |
| 466 | } | |
| 467 | ||
| 468 | return len; | |
| 469 | } | |
| 470 | ||
| 15884 | 471 | static gssize yahoo_xfer_write(const guchar *buffer, size_t size, PurpleXfer *xfer) |
| 7651 | 472 | { |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12143
diff
changeset
|
473 | gssize len; |
| 7651 | 474 | struct yahoo_xfer_data *xd = xfer->data; |
| 475 | ||
| 476 | if (!xd) | |
| 9798 | 477 | return -1; |
| 7651 | 478 | |
| 15884 | 479 | if (purple_xfer_get_type(xfer) != PURPLE_XFER_SEND) { |
| 9798 | 480 | return -1; |
| 7651 | 481 | } |
| 482 | ||
| 483 | len = write(xfer->fd, buffer, size); | |
| 484 | ||
| 7710 | 485 | if (len == -1) { |
| 15884 | 486 | if (purple_xfer_get_bytes_sent(xfer) >= purple_xfer_get_size(xfer)) |
| 487 | purple_xfer_set_completed(xfer, TRUE); | |
| 7710 | 488 | if ((errno != EAGAIN) && (errno != EINTR)) |
| 9798 | 489 | return -1; |
| 7710 | 490 | return 0; |
| 491 | } | |
| 492 | ||
| 15884 | 493 | if ((purple_xfer_get_bytes_sent(xfer) + len) >= purple_xfer_get_size(xfer)) |
| 494 | purple_xfer_set_completed(xfer, TRUE); | |
| 7651 | 495 | |
| 496 | return len; | |
| 497 | } | |
| 498 | ||
| 15884 | 499 | static void yahoo_xfer_cancel_send(PurpleXfer *xfer) |
| 7651 | 500 | { |
| 501 | struct yahoo_xfer_data *xfer_data; | |
| 502 | ||
| 503 | xfer_data = xfer->data; | |
| 504 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
505 | if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
506 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
507 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
508 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
509 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
510 | struct yahoo_packet *pkt; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
511 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
512 | gc = xfer_data->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
513 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
514 | account = purple_connection_get_account(gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
515 | if(xfer_data->xfer_idstring_for_relay) /* hack to see if file trans acc/info packet has been received */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
516 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
517 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
518 | YAHOO_STATUS_DISCONNECTED, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
519 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
520 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
521 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
522 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
523 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
524 | 66, -1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
525 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
526 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
527 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
528 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
529 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
530 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
531 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
532 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
533 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
534 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
535 | 222, 2); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
536 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
537 | yahoo_packet_send_and_free(pkt, yd); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
538 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
539 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
540 | |
| 7651 | 541 | if (xfer_data) |
| 542 | yahoo_xfer_data_free(xfer_data); | |
| 543 | xfer->data = NULL; | |
| 544 | } | |
| 545 | ||
| 15884 | 546 | static void yahoo_xfer_cancel_recv(PurpleXfer *xfer) |
| 7651 | 547 | { |
| 548 | struct yahoo_xfer_data *xfer_data; | |
| 549 | ||
| 550 | xfer_data = xfer->data; | |
| 551 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
552 | if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
553 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
554 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
555 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
556 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
557 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
558 | struct yahoo_packet *pkt; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
559 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
560 | gc = xfer_data->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
561 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
562 | account = purple_connection_get_account(gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
563 | if(!xfer_data->xfer_idstring_for_relay) /* hack to see if file trans acc/info packet has been received */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
564 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
565 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
566 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
567 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
568 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
569 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
570 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
571 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
572 | 222, 4); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
573 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
574 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
575 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
576 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
577 | YAHOO_STATUS_DISCONNECTED, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
578 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
579 | yahoo_packet_hash(pkt, "sssi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
580 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
581 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
582 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
583 | 66, -1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
584 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
585 | yahoo_packet_send_and_free(pkt, yd); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
586 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
587 | |
|
22201
434114a12ae4
Revert patch that added receive-only transfer support for Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21918
diff
changeset
|
588 | if (xfer_data) |
| 7651 | 589 | yahoo_xfer_data_free(xfer_data); |
| 590 | xfer->data = NULL; | |
| 591 | } | |
| 592 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
593 | static void yahoo_xfer_end(PurpleXfer *xfer_old) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
594 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
595 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
596 | PurpleXfer *xfer = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
597 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
598 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
599 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
600 | xfer_data = xfer_old->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
601 | if(xfer_data && xfer_data->version == 15 |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
602 | && purple_xfer_get_type(xfer_old) == PURPLE_XFER_RECEIVE |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
603 | && xfer_data->filename_list) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
604 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
605 | /* removing top of filename & size list completely */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
606 | g_free( xfer_data->filename_list->data ); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
607 | g_free( xfer_data->size_list->data ); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
608 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
609 | xfer_data->filename_list->data = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
610 | xfer_data->size_list->data = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
611 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
612 | xfer_data->filename_list = g_slist_delete_link(xfer_data->filename_list, xfer_data->filename_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
613 | xfer_data->size_list = g_slist_delete_link(xfer_data->size_list, xfer_data->size_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
614 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
615 | /* if there are still more files */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
616 | if(xfer_data->filename_list) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
617 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
618 | gchar* filename; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
619 | long filesize; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
620 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
621 | filename = xfer_data->filename_list->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
622 | filesize = atol( xfer_data->size_list->data ); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
623 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
624 | gc = xfer_data->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
625 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
626 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
627 | /* setting up xfer_data for next file's tranfer */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
628 | g_free(xfer_data->host); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
629 | g_free(xfer_data->path); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
630 | g_free(xfer_data->txbuf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
631 | g_free(xfer_data->rxqueue); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
632 | g_free(xfer_data->xfer_idstring_for_relay); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
633 | if (xfer_data->tx_handler) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
634 | purple_input_remove(xfer_data->tx_handler); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
635 | xfer_data->host = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
636 | xfer_data->host = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
637 | xfer_data->port = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
638 | xfer_data->expires = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
639 | xfer_data->started = FALSE; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
640 | xfer_data->txbuf = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
641 | xfer_data->txbuflen = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
642 | xfer_data->txbuf_written = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
643 | xfer_data->tx_handler = (int) NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
644 | xfer_data->rxqueue = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
645 | xfer_data->rxlen = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
646 | xfer_data->xfer_idstring_for_relay = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
647 | xfer_data->info_val_249 = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
648 | xfer_data->status_15 = STARTED; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
649 | xfer_data->firstoflist = FALSE; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
650 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
651 | /* Dereference xfer_data from old xfer */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
652 | xfer_old->data = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
653 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
654 | /* Build the file transfer handle. */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
655 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_RECEIVE, xfer_old->who); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
656 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
657 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
658 | if (xfer) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
659 | /* Set the info about the incoming file. */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
660 | char *utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
661 | purple_xfer_set_filename(xfer, utf8_filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
662 | g_free(utf8_filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
663 | purple_xfer_set_size(xfer, filesize); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
664 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
665 | xfer->data = xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
666 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
667 | /* Setup our I/O op functions */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
668 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
669 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
670 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
671 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
672 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
673 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
674 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
675 | purple_xfer_set_request_denied_fnc(xfer,yahoo_xfer_cancel_recv); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
676 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
677 | /*update map to current xfer*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
678 | g_hash_table_remove(yd->xfer_peer_idstring_map, xfer_data->xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
679 | g_hash_table_insert(yd->xfer_peer_idstring_map, xfer_data->xfer_idstring_between_peers, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
680 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
681 | /* Now perform the request */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
682 | purple_xfer_request(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
683 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
684 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
685 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
686 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
687 | if (xfer_data) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
688 | yahoo_xfer_data_free(xfer_data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
689 | xfer_old->data = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
690 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
691 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
692 | |
| 15884 | 693 | void yahoo_process_p2pfilexfer(PurpleConnection *gc, struct yahoo_packet *pkt) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
694 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
695 | GSList *l = pkt->hash; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
696 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
697 | char *me = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
698 | char *from = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
699 | char *service = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
700 | char *message = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
701 | char *command = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
702 | char *imv = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
703 | char *unknown = NULL; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
704 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
705 | /* Get all the necessary values from this new packet */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
706 | while(l != NULL) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
707 | { |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
708 | struct yahoo_pair *pair = l->data; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
709 | |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
710 | switch(pair->key) { |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
711 | case 5: /* Get who the packet is for */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
712 | me = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
713 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
714 | case 4: /* Get who the packet is from */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
715 | from = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
716 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
717 | case 49: /* Get the type of service */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
718 | service = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
719 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
720 | case 14: /* Get the 'message' of the packet */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
721 | message = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
722 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
723 | case 13: /* Get the command associated with this packet */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
724 | command = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
725 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
726 | case 63: /* IMVironment name and version */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
727 | imv = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
728 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
729 | case 64: /* Not sure, but it does vary with initialization of Doodle */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
730 | unknown = pair->value; /* So, I'll keep it (for a little while atleast) */ |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
731 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
732 | } |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
733 | |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
734 | l = l->next; |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
735 | } |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
736 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
737 | /* If this packet is an IMVIRONMENT, handle it accordingly */ |
|
13459
c20f00df92e5
[gaim-migrate @ 15833]
Daniel Atallah <datallah@pidgin.im>
parents:
13277
diff
changeset
|
738 | if(service != NULL && imv != NULL && !strcmp(service, "IMVIRONMENT")) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
739 | { |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
740 | /* Check for a Doodle packet and handle it accordingly */ |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
741 | if(strstr(imv, "doodle;") != NULL) |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
742 | yahoo_doodle_process(gc, me, from, command, message, imv); |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
743 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
744 | /* If an IMVIRONMENT packet comes without a specific imviroment name */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
745 | if(!strcmp(imv, ";0")) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
746 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
747 | /* It is unfortunately time to close all IMVironments with the remote client */ |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
748 | yahoo_doodle_command_got_shutdown(gc, from); |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
749 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
750 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
751 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
752 | |
| 15884 | 753 | void yahoo_process_filetransfer(PurpleConnection *gc, struct yahoo_packet *pkt) |
| 7651 | 754 | { |
| 755 | char *from = NULL; | |
| 756 | char *to = NULL; | |
| 757 | char *msg = NULL; | |
| 758 | char *url = NULL; | |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
759 | char *imv = NULL; |
| 7651 | 760 | long expires = 0; |
| 15884 | 761 | PurpleXfer *xfer; |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
762 | struct yahoo_data *yd; |
| 7651 | 763 | struct yahoo_xfer_data *xfer_data; |
| 764 | char *service = NULL; | |
| 765 | char *filename = NULL; | |
| 766 | unsigned long filesize = 0L; | |
| 767 | GSList *l; | |
| 768 | ||
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
769 | yd = gc->proto_data; |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
770 | |
| 7651 | 771 | for (l = pkt->hash; l; l = l->next) { |
| 772 | struct yahoo_pair *pair = l->data; | |
| 773 | ||
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
774 | switch (pair->key) { |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
775 | case 4: |
| 7651 | 776 | from = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
777 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
778 | case 5: |
| 7651 | 779 | to = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
780 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
781 | case 14: |
| 7651 | 782 | msg = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
783 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
784 | case 20: |
| 7651 | 785 | url = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
786 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
787 | case 38: |
| 7651 | 788 | expires = strtol(pair->value, NULL, 10); |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
789 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
790 | case 27: |
| 7651 | 791 | filename = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
792 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
793 | case 28: |
| 7651 | 794 | filesize = atol(pair->value); |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
795 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
796 | case 49: |
| 7651 | 797 | service = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
798 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
799 | case 63: |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
800 | imv = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
801 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
802 | } |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
803 | } |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
804 | |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
805 | /* |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
806 | * The remote user has changed their IMVironment. We |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
807 | * record it for later use. |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
808 | */ |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
809 | if (from && imv && service && (strcmp("IMVIRONMENT", service) == 0)) { |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
810 | g_hash_table_replace(yd->imvironments, g_strdup(from), g_strdup(imv)); |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
811 | return; |
| 7651 | 812 | } |
| 813 | ||
| 814 | if (pkt->service == YAHOO_SERVICE_P2PFILEXFER) { | |
| 10261 | 815 | if (service && (strcmp("FILEXFER", service) != 0)) { |
| 15884 | 816 | purple_debug_misc("yahoo", "unhandled service 0x%02x\n", pkt->service); |
| 7651 | 817 | return; |
| 818 | } | |
| 819 | } | |
| 820 | ||
| 821 | if (msg) { | |
| 822 | char *tmp; | |
| 823 | tmp = strchr(msg, '\006'); | |
| 824 | if (tmp) | |
| 825 | *tmp = '\0'; | |
| 826 | } | |
| 827 | ||
| 828 | if (!url || !from) | |
| 829 | return; | |
| 830 | ||
| 831 | /* Setup the Yahoo-specific file transfer data */ | |
| 832 | xfer_data = g_new0(struct yahoo_xfer_data, 1); | |
| 833 | xfer_data->gc = gc; | |
| 15884 | 834 | if (!purple_url_parse(url, &(xfer_data->host), &(xfer_data->port), &(xfer_data->path), NULL, NULL)) { |
| 7651 | 835 | g_free(xfer_data); |
| 836 | return; | |
| 837 | } | |
| 838 | ||
| 15884 | 839 | purple_debug_misc("yahoo_filexfer", "Host is %s, port is %d, path is %s, and the full url was %s.\n", |
| 7651 | 840 | xfer_data->host, xfer_data->port, xfer_data->path, url); |
| 841 | ||
| 842 | /* Build the file transfer handle. */ | |
| 15884 | 843 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_RECEIVE, from); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
844 | if (xfer) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
845 | { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
846 | xfer->data = xfer_data; |
| 7651 | 847 | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
848 | /* Set the info about the incoming file. */ |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
849 | if (filename) { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
850 | char *utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
| 15884 | 851 | purple_xfer_set_filename(xfer, utf8_filename); |
|
10976
96153d16e808
[gaim-migrate @ 12802]
Daniel Atallah <datallah@pidgin.im>
parents:
10937
diff
changeset
|
852 | g_free(utf8_filename); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
853 | } else { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
854 | gchar *start, *end; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
855 | start = g_strrstr(xfer_data->path, "/"); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
856 | if (start) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
857 | start++; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
858 | end = g_strrstr(xfer_data->path, "?"); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
859 | if (start && *start && end) { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
860 | char *utf8_filename; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
861 | filename = g_strndup(start, end - start); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
862 | utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
863 | g_free(filename); |
| 15884 | 864 | purple_xfer_set_filename(xfer, utf8_filename); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
865 | g_free(utf8_filename); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
866 | filename = NULL; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
867 | } |
| 7651 | 868 | } |
| 869 | ||
| 15884 | 870 | purple_xfer_set_size(xfer, filesize); |
| 7651 | 871 | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
872 | /* Setup our I/O op functions */ |
| 15884 | 873 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init); |
| 874 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); | |
| 875 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); | |
| 876 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); | |
| 877 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); | |
| 878 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); | |
| 879 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
880 | |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
881 | /* Now perform the request */ |
| 15884 | 882 | purple_xfer_request(xfer); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
883 | } |
| 7651 | 884 | } |
| 885 | ||
| 15884 | 886 | PurpleXfer *yahoo_new_xfer(PurpleConnection *gc, const char *who) |
| 7651 | 887 | { |
| 15884 | 888 | PurpleXfer *xfer; |
| 7651 | 889 | struct yahoo_xfer_data *xfer_data; |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
890 | |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
891 | g_return_val_if_fail(who != NULL, NULL); |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
892 | |
| 7651 | 893 | xfer_data = g_new0(struct yahoo_xfer_data, 1); |
| 894 | xfer_data->gc = gc; | |
|
19064
1680699bdbf4
Fix yahoo doodling to work with newer yahoo messenger clients. This breaks doodling with older Pidgin clients (trying to support both looked too painful). Fixes #1445.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
895 | |
| 7651 | 896 | /* Build the file transfer handle. */ |
| 15884 | 897 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
898 | if (xfer) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
899 | { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
900 | xfer->data = xfer_data; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
901 | |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
902 | /* Setup our I/O op functions */ |
| 15884 | 903 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init); |
| 904 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); | |
| 905 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); | |
| 906 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); | |
| 907 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); | |
| 908 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); | |
| 909 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
910 | } |
| 7651 | 911 | |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
912 | return xfer; |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
913 | } |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
914 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
915 | static gchar* yahoo_xfer_new_xfer_id() |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
916 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
917 | gchar *ans; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
918 | int i,j; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
919 | ans = g_strnfill(24, ' '); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
920 | ans[23] = '$'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
921 | ans[22] = '$'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
922 | for(i = 0; i < 22; i++) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
923 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
924 | j = g_random_int_range (0,61); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
925 | if(j < 26) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
926 | ans[i] = j + 'a'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
927 | else if(j < 52) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
928 | ans[i] = j - 26 + 'A'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
929 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
930 | ans[i] = j - 52 + '0'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
931 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
932 | return ans; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
933 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
934 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
935 | static void yahoo_xfer_dns_connected_15(GSList *hosts, gpointer data, const char *error_message) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
936 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
937 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
938 | struct yahoo_xfer_data *xd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
939 | struct sockaddr_in *addr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
940 | struct yahoo_packet *pkt; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
941 | long actaddr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
942 | long a,b,c,d; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
943 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
944 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
945 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
946 | gchar *url; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
947 | gchar *filename; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
948 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
949 | if (!(xfer = data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
950 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
951 | if (!(xd = xfer->data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
952 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
953 | gc = xd->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
954 | account = purple_connection_get_account(gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
955 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
956 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
957 | if(!hosts) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
958 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
959 | purple_debug_error("yahoo", "Unable to find an IP address for relay.msg.yahoo.com\n"); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
960 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
961 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
962 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
963 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
964 | /* Discard the length... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
965 | hosts = g_slist_remove(hosts, hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
966 | if(!hosts) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
967 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
968 | purple_debug_error("yahoo", "Unable to find an IP address for relay.msg.yahoo.com\n"); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
969 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
970 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
971 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
972 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
973 | /*TODO:actually, u must try with addr no.1 , if its not working addr no.2 .....*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
974 | addr = hosts->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
975 | actaddr = addr->sin_addr.s_addr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
976 | d = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
977 | actaddr = (actaddr - d) / 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
978 | c = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
979 | actaddr = (actaddr - c) / 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
980 | b = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
981 | actaddr = (actaddr - b) / 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
982 | a = actaddr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
983 | if(yd->jp) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
984 | xd->port = YAHOOJP_XFER_RELAY_PORT; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
985 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
986 | xd->port = YAHOO_XFER_RELAY_PORT; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
987 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
988 | url = g_strdup_printf("%ld.%ld.%ld.%ld", d, c, b, a); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
989 | if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
990 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
991 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
992 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
993 | g_free(url); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
994 | /* Free the address... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
995 | g_free(hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
996 | hosts = g_slist_remove(hosts, hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
997 | addr = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
998 | while (hosts != NULL) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
999 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1000 | /* Discard the length... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1001 | hosts = g_slist_remove(hosts, hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1002 | /* Free the address... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1003 | g_free(hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1004 | hosts = g_slist_remove(hosts, hosts->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1005 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1006 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1007 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1008 | filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1009 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1010 | yahoo_packet_hash(pkt, "ssssis", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1011 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1012 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1013 | 265, xd->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1014 | 27, filename, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1015 | 249, 3, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1016 | 250, xd->host); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1017 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1018 | g_free(filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1019 | yahoo_packet_send_and_free(pkt, yd); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1020 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1021 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1022 | |
| 15884 | 1023 | void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file) |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1024 | { |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1025 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1026 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1027 | int ver = 0; |
| 15884 | 1028 | PurpleXfer *xfer = yahoo_new_xfer(gc, who); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1029 | YahooFriend *yf = yahoo_friend_find(gc, who); |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1030 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1031 | /* To determine whether client uses ymsg 15 i.e. client is higher than YM 7 */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1032 | if(yf && yf->version_id > 500000) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1033 | ver=15; |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1034 | g_return_if_fail(xfer != NULL); |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1035 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1036 | if(ver == 15) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1037 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1038 | xfer_data = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1039 | xfer_data->status_15 = STARTED; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1040 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1041 | xfer_data->version = 15; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1042 | xfer_data->xfer_idstring_between_peers = yahoo_xfer_new_xfer_id(); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1043 | g_hash_table_insert(yd->xfer_peer_idstring_map, xfer_data->xfer_idstring_between_peers, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1044 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1045 | |
| 7651 | 1046 | /* Now perform the request */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
1047 | if (file) |
| 15884 | 1048 | purple_xfer_request_accepted(xfer, file); |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9306
diff
changeset
|
1049 | else |
| 15884 | 1050 | purple_xfer_request(xfer); |
| 7651 | 1051 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1052 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1053 | static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message);/*using this in recv_cb*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1054 | static void yahoo_xfer_recv_cb_15(gpointer data, gint source, PurpleInputCondition condition) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1055 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1056 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1057 | struct yahoo_xfer_data *xd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1058 | int did; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1059 | gchar* buf; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1060 | gchar* t; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1061 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1062 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1063 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1064 | xfer = data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1065 | xd = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1066 | account = purple_connection_get_account(xd->gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1067 | gc = xd->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1068 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1069 | buf=g_strnfill(1000, 0); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1070 | while((did = read(source, buf, 998)) > 0) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1071 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1072 | xd->txbuflen += did; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1073 | buf[did] = '\0'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1074 | t = xd->txbuf; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1075 | xd->txbuf = g_strconcat(t,buf,NULL); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1076 | g_free(t); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1077 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1078 | g_free(buf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1079 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1080 | if (did < 0 && errno == EAGAIN) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1081 | else if (did < 0) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1082 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1083 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1084 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1085 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1086 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1087 | purple_input_remove(xd->tx_handler); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1088 | xd->tx_handler = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1089 | xd->txbuflen = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1090 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1091 | if(xd->status_15 == HEAD_REQUESTED) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1092 | xd->status_15 = HEAD_REPLY_RECEIVED; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1093 | close(source);/*Is this required?*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1094 | g_free(xd->txbuf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1095 | xd->txbuf = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1096 | if (purple_proxy_connect(NULL, account, xd->host, xd->port, yahoo_xfer_connected_15, xfer) == NULL) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1097 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1098 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1099 | _("Unable to establish file descriptor.")); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1100 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1101 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1102 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1103 | purple_debug_error("yahoo","Unrecognized yahoo file transfer mode and stage (ymsg15):%d,%d\n", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1104 | purple_xfer_get_type(xfer), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1105 | xd->status_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1106 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1107 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1108 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1109 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1110 | static void yahoo_xfer_send_cb_15(gpointer data, gint source, PurpleInputCondition condition) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1111 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1112 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1113 | struct yahoo_xfer_data *xd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1114 | int remaining, written; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1115 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1116 | xfer = data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1117 | xd = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1118 | remaining = xd->txbuflen - xd->txbuf_written; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1119 | written = write(source, xd->txbuf + xd->txbuf_written, remaining); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1120 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1121 | if (written < 0 && errno == EAGAIN) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1122 | written = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1123 | else if (written <= 0) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1124 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1125 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1126 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1127 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1128 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1129 | if (written < remaining) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1130 | xd->txbuf_written += written; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1131 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1132 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1133 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1134 | purple_input_remove(xd->tx_handler); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1135 | xd->tx_handler = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1136 | g_free(xd->txbuf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1137 | xd->txbuf = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1138 | xd->txbuflen = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1139 | xd->txbuf_written = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1140 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1141 | if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE && xd->status_15 == STARTED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1142 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1143 | xd->status_15 = HEAD_REQUESTED; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1144 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_READ, yahoo_xfer_recv_cb_15, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1145 | yahoo_xfer_recv_cb_15(xfer, source, PURPLE_INPUT_READ); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1146 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1147 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE && xd->status_15 == HEAD_REPLY_RECEIVED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1148 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1149 | xd->status_15 = TRANSFER_PHASE; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1150 | xfer->fd = source; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1151 | purple_xfer_start(xfer, source, NULL, 0); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1152 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1153 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND && xd->status_15 == ACCEPTED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1154 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1155 | xd->status_15 = TRANSFER_PHASE; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1156 | xfer->fd = source; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1157 | purple_xfer_start(xfer, source, NULL, 0); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1158 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1159 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1160 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1161 | purple_debug_error("yahoo", "Unrecognized yahoo file transfer mode and stage (ymsg15):%d,%d\n", purple_xfer_get_type(xfer), xd->status_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1162 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1163 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1164 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1165 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1166 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1167 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1168 | static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1169 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1170 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1171 | struct yahoo_xfer_data *xd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1172 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1173 | struct yahoo_data* yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1174 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1175 | if (!(xfer = data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1176 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1177 | if (!(xd = xfer->data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1178 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1179 | yd = xd->gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1180 | account = purple_connection_get_account(xd->gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1181 | if ((source < 0) || (xd->path == NULL) || (xd->host == NULL)) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1182 | purple_xfer_error(PURPLE_XFER_RECEIVE, purple_xfer_get_account(xfer), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1183 | xfer->who, _("Unable to connect.")); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1184 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1185 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1186 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1187 | /* The first time we get here, assemble the tx buffer */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1188 | if (xd->txbuflen == 0) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1189 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1190 | gchar* cookies; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1191 | cookies = yahoo_get_cookies(xd->gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1192 | if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND && xd->status_15 == ACCEPTED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1193 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1194 | xd->txbuf = g_strdup_printf("POST /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nContent-Length: %ld\r\nCache-Control: no-cache\r\n\r\n", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1195 | purple_url_encode(xd->xfer_idstring_for_relay), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1196 | purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1197 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1198 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1199 | xd->host, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1200 | (long int)xfer->size); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1201 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1202 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE && xd->status_15 == STARTED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1203 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1204 | xd->txbuf = g_strdup_printf("HEAD /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nAccept:*/*\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost:%s\r\nContent-Length: 0\r\nCache-Control: no-cache\r\n\r\n", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1205 | purple_url_encode(xd->xfer_idstring_for_relay), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1206 | purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1207 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1208 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1209 | xd->host); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1210 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1211 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE && xd->status_15 == HEAD_REPLY_RECEIVED) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1212 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1213 | xd->txbuf = g_strdup_printf("GET /relay?token=%s&sender=%s&recver=%s HTTP/1.1\r\nCookie:%s\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost:%s\r\nConnection: Keep-Alive\r\n\r\n", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1214 | purple_url_encode(xd->xfer_idstring_for_relay), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1215 | purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1216 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1217 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1218 | xd->host); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1219 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1220 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1221 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1222 | purple_debug_error("yahoo", "Unrecognized yahoo file transfer mode and stage (ymsg15):%d,%d\n", purple_xfer_get_type(xfer), xd->status_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1223 | g_free(cookies); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1224 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1225 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1226 | xd->txbuflen = strlen(xd->txbuf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1227 | xd->txbuf_written = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1228 | g_free(cookies); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1229 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1230 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1231 | if (!xd->tx_handler) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1232 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1233 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1234 | yahoo_xfer_send_cb_15, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1235 | yahoo_xfer_send_cb_15(xfer, source, PURPLE_INPUT_WRITE); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1236 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1237 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1238 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1239 | void yahoo_process_filetrans_15(PurpleConnection *gc, struct yahoo_packet *pkt) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1240 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1241 | char *from = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1242 | char *to = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1243 | char *imv = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1244 | long val_222 = 0L; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1245 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1246 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1247 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1248 | char *service = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1249 | char *filename = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1250 | char *xfer_idstring_between_peers = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1251 | unsigned long filesize = 0L; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1252 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1253 | GSList *filename_list = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1254 | GSList *size_list = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1255 | int nooffiles = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1256 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1257 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1258 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1259 | for (l = pkt->hash; l; l = l->next) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1260 | struct yahoo_pair *pair = l->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1261 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1262 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1263 | case 4: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1264 | from = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1265 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1266 | case 5: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1267 | to = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1268 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1269 | case 265: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1270 | xfer_idstring_between_peers = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1271 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1272 | case 27: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1273 | filename_list = g_slist_prepend(filename_list, g_strdup(pair->value)); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1274 | nooffiles++; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1275 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1276 | case 28: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1277 | size_list = g_slist_prepend(size_list, g_strdup(pair->value)); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1278 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1279 | case 222: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1280 | val_222 = atol(pair->value); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1281 | /* 1=send, 2=cancel, 3=accept, 4=reject */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1282 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1283 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1284 | /*check for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1285 | case 49: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1286 | service = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1287 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1288 | case 63: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1289 | imv = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1290 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1291 | /*end check*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1292 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1293 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1294 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1295 | if(!xfer_idstring_between_peers) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1296 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1297 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1298 | if(val_222 == 2 || val_222 == 4) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1299 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1300 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1301 | xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1302 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1303 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1304 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1305 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1306 | if(val_222 == 3) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1307 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1308 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1309 | xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1310 | if(!xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1311 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1312 | /* |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1313 | * In the file trans info packet tht we must reply with , we are supposed to mention the ip address... |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1314 | * purple connect does not give me a way of finding the ip address... |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1315 | * so, purple dnsquery is used... but retries, trying with next ip address etc. is not implemented..TODO |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1316 | */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1317 | if (yd->jp) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1318 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1319 | purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1320 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1321 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1322 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1323 | purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1324 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1325 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1326 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1327 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1328 | /*processing for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it.*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1329 | /* |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1330 | * The remote user has changed their IMVironment. We |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1331 | * record it for later use. |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1332 | */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1333 | if (from && imv && service && (strcmp("IMVIRONMENT", service) == 0)) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1334 | g_hash_table_replace(yd->imvironments, g_strdup(from), g_strdup(imv)); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1335 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1336 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1337 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1338 | if (pkt->service == YAHOO_SERVICE_P2PFILEXFER) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1339 | if (service && (strcmp("FILEXFER", service) != 0)) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1340 | purple_debug_misc("yahoo", "unhandled service 0x%02x\n", pkt->service); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1341 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1342 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1343 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1344 | /*end processing*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1345 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1346 | if(!filename_list) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1347 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1348 | /* have to change list into order in which client at other end sends */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1349 | filename_list = g_slist_reverse(filename_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1350 | size_list = g_slist_reverse(size_list); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1351 | filename = filename_list->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1352 | filesize = atol(size_list->data); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1353 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1354 | if(!from) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1355 | xfer_data = g_new0(struct yahoo_xfer_data, 1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1356 | xfer_data->version = 15; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1357 | xfer_data->firstoflist = TRUE; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1358 | xfer_data->gc = gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1359 | xfer_data->xfer_idstring_between_peers = g_strdup(xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1360 | xfer_data->filename_list = filename_list; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1361 | xfer_data->size_list = size_list; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1362 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1363 | /* Build the file transfer handle. */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1364 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_RECEIVE, from); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1365 | xfer->message = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1366 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1367 | if (xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1368 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1369 | /* Set the info about the incoming file. */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1370 | char *utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1371 | purple_xfer_set_filename(xfer, utf8_filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1372 | g_free(utf8_filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1373 | purple_xfer_set_size(xfer, filesize); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1374 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1375 | xfer->data = xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1376 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1377 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1378 | /* Setup our I/O op functions */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1379 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1380 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1381 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1382 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1383 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1384 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1385 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1386 | purple_xfer_set_request_denied_fnc(xfer,yahoo_xfer_cancel_recv); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1387 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1388 | g_hash_table_insert(yd->xfer_peer_idstring_map, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1389 | xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1390 | xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1391 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1392 | if(nooffiles > 1) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1393 | gchar* message; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1394 | message = g_strdup_printf(_("%s is trying to send you a group of %d files.\n"), xfer->who, nooffiles); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1395 | purple_xfer_conversation_write(xfer, message, FALSE); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1396 | g_free(message); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1397 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1398 | /* Now perform the request */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1399 | purple_xfer_request(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1400 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1401 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1402 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1403 | void yahoo_process_filetrans_info_15(PurpleConnection *gc, struct yahoo_packet *pkt) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1404 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1405 | char *from = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1406 | char *to = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1407 | char *url = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1408 | long val_249 = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1409 | long val_66 = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1410 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1411 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1412 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1413 | char *filename = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1414 | char *xfer_idstring_between_peers = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1415 | char *xfer_idstring_for_relay = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1416 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1417 | struct yahoo_packet *pkt_to_send; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1418 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1419 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1420 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1421 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1422 | for (l = pkt->hash; l; l = l->next) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1423 | struct yahoo_pair *pair = l->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1424 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1425 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1426 | case 4: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1427 | from = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1428 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1429 | case 5: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1430 | to = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1431 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1432 | case 265: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1433 | xfer_idstring_between_peers = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1434 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1435 | case 27: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1436 | filename = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1437 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1438 | case 66: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1439 | val_66 = strtol(pair->value, NULL, 10); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1440 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1441 | case 249: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1442 | val_249 = strtol(pair->value, NULL, 10); /* |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1443 | * really pissed off with this- i hv seen 2 occurences of this |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1444 | * being 1(its normally 3) - and in those cases, the url |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1445 | * format and corresponding processing seems to be different |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1446 | * (i havent tested - couldnt reproduce a 1), although i |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1447 | * guess its easier. |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1448 | */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1449 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1450 | case 250: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1451 | url = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1452 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1453 | case 251: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1454 | xfer_idstring_for_relay = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1455 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1456 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1457 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1458 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1459 | if(!xfer_idstring_between_peers) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1460 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1461 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1462 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1463 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1464 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1465 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1466 | if(val_66==-1) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1467 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1468 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1469 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1470 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1471 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1472 | xfer_data = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1473 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1474 | xfer_data->info_val_249 = val_249; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1475 | xfer_data->xfer_idstring_for_relay = g_strdup(xfer_idstring_for_relay); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1476 | if (!purple_url_parse(url, &(xfer_data->host), &(xfer_data->port), &(xfer_data->path), NULL, NULL)) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1477 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1478 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1479 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1480 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1481 | account = purple_connection_get_account(xfer_data->gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1482 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1483 | pkt_to_send = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_ACC_15, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1484 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1485 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1486 | yahoo_packet_hash(pkt_to_send, "ssssisi", |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1487 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1488 | 5, xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1489 | 265, xfer_data->xfer_idstring_between_peers, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1490 | 27, xfer->filename, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1491 | 249, xfer_data->info_val_249, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1492 | 251, xfer_data->xfer_idstring_for_relay, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1493 | 222, 3); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1494 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1495 | yahoo_packet_send_and_free(pkt_to_send, yd); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1496 | if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1497 | yahoo_xfer_connected_15, xfer) == NULL) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1498 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1499 | _("Unable to establish file descriptor.")); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1500 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1501 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1502 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1503 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1504 | /*TODO: Check filename etc. No probs till some hacker comes in the way*/ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1505 | void yahoo_process_filetrans_acc_15(PurpleConnection *gc, struct yahoo_packet *pkt) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1506 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1507 | gchar *xfer_idstring_between_peers = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1508 | gchar *xfer_idstring_for_relay = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1509 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1510 | struct yahoo_data *yd; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1511 | struct yahoo_xfer_data *xfer_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1512 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1513 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1514 | long val_66 = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1515 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1516 | yd = gc->proto_data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1517 | for (l = pkt->hash; l; l = l->next) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1518 | struct yahoo_pair *pair = l->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1519 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1520 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1521 | case 251: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1522 | xfer_idstring_for_relay = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1523 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1524 | case 265: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1525 | xfer_idstring_between_peers = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1526 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1527 | case 66: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1528 | val_66 = atol(pair->value); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1529 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1530 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1531 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1532 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xfer_idstring_between_peers); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1533 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1534 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1535 | if(val_66 == -1 || !(xfer_idstring_for_relay)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1536 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1537 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1538 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1539 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1540 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1541 | xfer_data = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1542 | xfer_data->xfer_idstring_for_relay = g_strdup(xfer_idstring_for_relay); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1543 | xfer_data->status_15 = ACCEPTED; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1544 | account = purple_connection_get_account(gc); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1545 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1546 | if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1547 | yahoo_xfer_connected_15, xfer) == NULL) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1548 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1549 | purple_notify_error(gc, NULL, _("File Transfer Failed"),_("Unable to connect")); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1550 | purple_xfer_cancel_remote(xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1551 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1552 | } |