Wed, 12 Nov 2008 10:18:49 +0000
propagate from branch 'im.pidgin.pidgin' (head 9f21d921daaff1f32e52c0c6857d7f9244c87cb4)
to branch 'im.pidgin.soc.2008.yahoo' (head 9af4fa4d22cfd9944dab22e1ff551df6632eb1ab)
| 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" | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
29 | #include "network.h" |
| 7651 | 30 | #include "notify.h" |
| 31 | #include "proxy.h" | |
| 32 | #include "ft.h" | |
| 33 | #include "yahoo.h" | |
| 10392 | 34 | #include "yahoo_packet.h" |
| 7651 | 35 | #include "yahoo_filexfer.h" |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
36 | #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
|
37 | #include "yahoo_friend.h" |
| 7651 | 38 | |
| 39 | struct yahoo_xfer_data { | |
| 40 | gchar *host; | |
| 41 | gchar *path; | |
| 42 | int port; | |
| 15884 | 43 | PurpleConnection *gc; |
| 7651 | 44 | long expires; |
| 45 | gboolean started; | |
|
13272
fd4f3356640f
[gaim-migrate @ 15637]
Daniel Atallah <datallah@pidgin.im>
parents:
13201
diff
changeset
|
46 | gchar *txbuf; |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
47 | gsize txbuflen; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
48 | gsize txbuf_written; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
49 | guint tx_handler; |
| 7651 | 50 | gchar *rxqueue; |
| 51 | guint rxlen; | |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
52 | gchar *xfer_peer_idstring; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
53 | gchar *xfer_idstring_for_relay; |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
54 | int version; /* 0 for old, 15 for Y7(YMSG 15) */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
55 | int info_val_249; |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
56 | |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
57 | enum { |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
58 | STARTED = 0, |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
59 | HEAD_REQUESTED, |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
60 | HEAD_REPLY_RECEIVED, |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
61 | TRANSFER_PHASE, |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
62 | ACCEPTED, |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
63 | P2P_HEAD_REQUESTED, |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
64 | P2P_HEAD_REPLIED, |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
65 | P2P_GET_REQUESTED |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
66 | } status_15; |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
67 | |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
68 | /* contains all filenames, in case of multiple transfers, with the first |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
69 | * one in the list being the current file's name (ymsg15) */ |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
70 | GSList *filename_list; |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
71 | GSList *size_list; /* corresponds to filename_list, with size as **STRING** */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
72 | gboolean firstoflist; |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
73 | gchar *xfer_url; /* url of the file, used when we are p2p server */ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
74 | int yahoo_local_p2p_ft_server_fd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
75 | int yahoo_local_p2p_ft_server_port; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
76 | int yahoo_p2p_ft_server_watcher; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
77 | int input_event; |
| 7651 | 78 | }; |
| 79 | ||
| 80 | static void yahoo_xfer_data_free(struct yahoo_xfer_data *xd) | |
| 81 | { | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
82 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
83 | 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
|
84 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
85 | GSList *l; |
|
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 | gc = xd->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
88 | 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
|
89 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
90 | /* remove entry from map */ |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
91 | if(xd->xfer_peer_idstring) { |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
92 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xd->xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
93 | if(xfer) |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
94 | g_hash_table_remove(yd->xfer_peer_idstring_map, xd->xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
95 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
96 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
97 | /* empty file & filesize list */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
98 | 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
|
99 | 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
|
100 | l->data=NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
101 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
102 | 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
|
103 | 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
|
104 | l->data=NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
105 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
106 | 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
|
107 | 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
|
108 | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
109 | g_free(xd->host); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
110 | g_free(xd->path); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
111 | g_free(xd->txbuf); |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
112 | g_free(xd->xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
113 | g_free(xd->xfer_idstring_for_relay); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
114 | if (xd->tx_handler) |
| 15884 | 115 | purple_input_remove(xd->tx_handler); |
| 7651 | 116 | g_free(xd); |
| 117 | } | |
| 118 | ||
| 15884 | 119 | 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
|
120 | { |
| 15884 | 121 | PurpleXfer *xfer; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
122 | struct yahoo_xfer_data *xd; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
123 | int remaining, written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
124 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
125 | xfer = data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
126 | xd = xfer->data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
127 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
128 | remaining = xd->txbuflen - xd->txbuf_written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
129 | written = write(xfer->fd, xd->txbuf + xd->txbuf_written, remaining); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
130 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
131 | if (written < 0 && errno == EAGAIN) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
132 | written = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
133 | else if (written <= 0) { |
| 15884 | 134 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
| 135 | purple_xfer_cancel_remote(xfer); | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
136 | return; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
137 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
138 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
139 | if (written < remaining) { |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
140 | xd->txbuf_written += written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
141 | return; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
142 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
143 | |
| 15884 | 144 | purple_input_remove(xd->tx_handler); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
145 | xd->tx_handler = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
146 | g_free(xd->txbuf); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
147 | xd->txbuf = NULL; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
148 | xd->txbuflen = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
149 | |
| 15884 | 150 | purple_xfer_start(xfer, source, NULL, 0); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
151 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
152 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
153 | |
|
14182
517f4531b8a0
[gaim-migrate @ 16754]
Mark Doliner <markdoliner@pidgin.im>
parents:
14170
diff
changeset
|
154 | static void yahoo_receivefile_connected(gpointer data, gint source, const gchar *error_message) |
| 7651 | 155 | { |
| 15884 | 156 | PurpleXfer *xfer; |
| 7651 | 157 | struct yahoo_xfer_data *xd; |
| 158 | ||
| 15884 | 159 | purple_debug(PURPLE_DEBUG_INFO, "yahoo", |
| 7651 | 160 | "AAA - in yahoo_receivefile_connected\n"); |
| 161 | if (!(xfer = data)) | |
| 162 | return; | |
| 163 | if (!(xd = xfer->data)) | |
| 164 | return; | |
|
13144
e8c3eafab5f8
[gaim-migrate @ 15506]
Evan Schoenberg <evands@pidgin.im>
parents:
12412
diff
changeset
|
165 | if ((source < 0) || (xd->path == NULL) || (xd->host == NULL)) { |
| 15884 | 166 | 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
|
167 | xfer->who, _("Unable to connect.")); |
| 15884 | 168 | purple_xfer_cancel_remote(xfer); |
| 7651 | 169 | return; |
| 170 | } | |
| 171 | ||
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
172 | xfer->fd = source; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
173 | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
174 | /* The first time we get here, assemble the tx buffer */ |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
175 | 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
|
176 | 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
|
177 | xd->path, xd->host); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
178 | xd->txbuflen = strlen(xd->txbuf); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
179 | xd->txbuf_written = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
180 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
181 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
182 | if (!xd->tx_handler) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
183 | { |
| 15884 | 184 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
185 | yahoo_receivefile_send_cb, xfer); |
| 15884 | 186 | yahoo_receivefile_send_cb(xfer, source, PURPLE_INPUT_WRITE); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
187 | } |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
188 | } |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
189 | |
| 15884 | 190 | 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
|
191 | { |
| 15884 | 192 | PurpleXfer *xfer; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
193 | struct yahoo_xfer_data *xd; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
194 | int written, remaining; |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
195 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
196 | xfer = data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
197 | xd = xfer->data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
198 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
199 | remaining = xd->txbuflen - xd->txbuf_written; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
200 | written = write(xfer->fd, xd->txbuf + xd->txbuf_written, remaining); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
201 | |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
202 | if (written < 0 && errno == EAGAIN) |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
203 | written = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
204 | else if (written <= 0) { |
| 15884 | 205 | purple_debug_error("yahoo", "Unable to write in order to start ft errno = %d\n", errno); |
| 206 | purple_xfer_cancel_remote(xfer); | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
207 | return; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
208 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
209 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
210 | if (written < remaining) { |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
211 | xd->txbuf_written += written; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
212 | return; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
213 | } |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
214 | |
| 15884 | 215 | purple_input_remove(xd->tx_handler); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
216 | xd->tx_handler = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
217 | g_free(xd->txbuf); |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
218 | xd->txbuf = NULL; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
219 | xd->txbuflen = 0; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
220 | |
| 15884 | 221 | purple_xfer_start(xfer, source, NULL, 0); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
222 | } |
| 7651 | 223 | |
|
14182
517f4531b8a0
[gaim-migrate @ 16754]
Mark Doliner <markdoliner@pidgin.im>
parents:
14170
diff
changeset
|
224 | static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) |
| 7651 | 225 | { |
| 15884 | 226 | PurpleXfer *xfer; |
| 7651 | 227 | struct yahoo_xfer_data *xd; |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
228 | struct yahoo_packet *pkt; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
229 | gchar *size, *filename, *encoded_filename, *header; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
230 | guchar *pkt_buf; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
231 | const char *host; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
232 | int port; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
233 | size_t content_length, header_len, pkt_buf_len; |
| 15884 | 234 | PurpleConnection *gc; |
| 235 | PurpleAccount *account; | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
236 | struct yahoo_data *yd; |
| 7651 | 237 | |
| 15884 | 238 | purple_debug(PURPLE_DEBUG_INFO, "yahoo", |
| 7651 | 239 | "AAA - in yahoo_sendfile_connected\n"); |
| 240 | if (!(xfer = data)) | |
| 241 | return; | |
| 242 | if (!(xd = xfer->data)) | |
| 243 | return; | |
| 244 | ||
| 245 | if (source < 0) { | |
| 15884 | 246 | 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
|
247 | xfer->who, _("Unable to connect.")); |
| 15884 | 248 | purple_xfer_cancel_remote(xfer); |
| 7651 | 249 | return; |
| 250 | } | |
| 251 | ||
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
252 | xfer->fd = source; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
253 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
254 | /* Assemble the tx buffer */ |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
255 | gc = xd->gc; |
| 15884 | 256 | account = purple_connection_get_account(gc); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
257 | yd = gc->proto_data; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
258 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
259 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
260 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
| 7651 | 261 | |
| 15884 | 262 | size = g_strdup_printf("%" G_GSIZE_FORMAT, purple_xfer_get_size(xfer)); |
| 263 | 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
|
264 | encoded_filename = yahoo_string_encode(gc, filename, NULL); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
265 | |
| 15884 | 266 | 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
|
267 | 5, xfer->who, 14, "", 27, encoded_filename, 28, size); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
268 | g_free(size); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
269 | g_free(encoded_filename); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
270 | g_free(filename); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
271 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
272 | content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
273 | |
|
24603
2a7015e8c12c
Patch from 'siddish' to fix Yahoo! file transfers with older (i.e. non-p15)
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22966
diff
changeset
|
274 | pkt_buf_len = yahoo_packet_build(pkt, 4, FALSE, yd->jp, &pkt_buf); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
275 | yahoo_packet_free(pkt); |
| 7651 | 276 | |
| 15884 | 277 | host = purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST); |
| 278 | 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
|
279 | header = g_strdup_printf( |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
280 | "POST http://%s:%d/notifyft HTTP/1.0\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
281 | "Content-length: %" G_GSIZE_FORMAT "\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
282 | "Host: %s:%d\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
283 | "Cookie: Y=%s; T=%s\r\n" |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
284 | "\r\n", |
| 15884 | 285 | host, port, content_length + 4 + purple_xfer_get_size(xfer), |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
286 | host, port, yd->cookie_y, yd->cookie_t); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
287 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
288 | header_len = strlen(header); |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
13144
diff
changeset
|
289 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
290 | xd->txbuflen = header_len + pkt_buf_len + 4; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
291 | xd->txbuf = g_malloc(xd->txbuflen); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
292 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
293 | memcpy(xd->txbuf, header, header_len); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
294 | g_free(header); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
295 | memcpy(xd->txbuf + header_len, pkt_buf, pkt_buf_len); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
296 | g_free(pkt_buf); |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
297 | 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
|
298 | |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
299 | xd->txbuf_written = 0; |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
300 | |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
301 | if (xd->tx_handler == 0) |
|
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
302 | { |
| 15884 | 303 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
304 | yahoo_sendfile_send_cb, xfer); |
| 15884 | 305 | yahoo_sendfile_send_cb(xfer, source, PURPLE_INPUT_WRITE); |
|
14146
4413802cb7a9
[gaim-migrate @ 16705]
Mark Doliner <markdoliner@pidgin.im>
parents:
13851
diff
changeset
|
306 | } |
| 7651 | 307 | } |
| 308 | ||
| 15884 | 309 | static void yahoo_xfer_init(PurpleXfer *xfer) |
| 7651 | 310 | { |
| 311 | struct yahoo_xfer_data *xfer_data; | |
| 15884 | 312 | PurpleConnection *gc; |
| 313 | PurpleAccount *account; | |
| 7827 | 314 | struct yahoo_data *yd; |
| 7651 | 315 | |
| 316 | xfer_data = xfer->data; | |
| 317 | gc = xfer_data->gc; | |
| 7827 | 318 | yd = gc->proto_data; |
| 15884 | 319 | account = purple_connection_get_account(gc); |
| 7651 | 320 | |
| 15884 | 321 | if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) { |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
322 | if (yd->jp) { |
| 15884 | 323 | if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), |
| 324 | purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), | |
|
14170
f611621bc8a0
[gaim-migrate @ 16742]
Mark Doliner <markdoliner@pidgin.im>
parents:
14151
diff
changeset
|
325 | yahoo_sendfile_connected, xfer) == NULL) |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
326 | { |
| 15884 | 327 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
328 | _("Unable to establish file descriptor.")); |
| 15884 | 329 | purple_xfer_cancel_remote(xfer); |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
330 | } |
| 8282 | 331 | } else { |
| 15884 | 332 | if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), |
| 333 | purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), | |
|
14170
f611621bc8a0
[gaim-migrate @ 16742]
Mark Doliner <markdoliner@pidgin.im>
parents:
14151
diff
changeset
|
334 | yahoo_sendfile_connected, xfer) == NULL) |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
335 | { |
| 15884 | 336 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
10937
1753f4709889
[gaim-migrate @ 12721]
Peter Lawler <pidgin@bleeter.id.au>
parents:
10654
diff
changeset
|
337 | _("Unable to establish file descriptor.")); |
| 15884 | 338 | purple_xfer_cancel_remote(xfer); |
| 8282 | 339 | } |
| 7651 | 340 | } |
| 341 | } 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
|
342 | xfer->fd = -1; |
| 15884 | 343 | 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
|
344 | yahoo_receivefile_connected, xfer) == NULL) { |
| 15884 | 345 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
| 7651 | 346 | _("Unable to establish file descriptor.")); |
| 15884 | 347 | purple_xfer_cancel_remote(xfer); |
| 7651 | 348 | } |
| 349 | } | |
| 350 | } | |
| 351 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
352 | 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
|
353 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
354 | 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
|
355 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
356 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
357 | 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
|
358 | 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
|
359 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
360 | 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
|
361 | 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
|
362 | 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
|
363 | 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
|
364 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
365 | 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
|
366 | gchar *filename; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
367 | 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
|
368 | 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
|
369 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
370 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
371 | 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
|
372 | 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
|
373 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
374 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
375 | 222, 1, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
376 | 266, 1, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
377 | 302, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
378 | 300, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
379 | 27, filename, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
380 | 28, xfer->size, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
381 | 301, 268, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
382 | 303, 268); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
383 | g_free(filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
384 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
385 | 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
|
386 | 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
|
387 | 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
|
388 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
389 | 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
|
390 | 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
|
391 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
392 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
393 | 222, 3); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
394 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
395 | 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
|
396 | 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
|
397 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
398 | 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
|
399 | 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
|
400 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
401 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
402 | 271, 1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
403 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
404 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
405 | 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
|
406 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
407 | |
| 15884 | 408 | static void yahoo_xfer_start(PurpleXfer *xfer) |
| 7651 | 409 | { |
| 410 | /* We don't need to do anything here, do we? */ | |
| 411 | } | |
| 412 | ||
|
11897
10853b830964
[gaim-migrate @ 14188]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11801
diff
changeset
|
413 | static guint calculate_length(const gchar *l, size_t len) |
| 7651 | 414 | { |
| 415 | int i; | |
| 416 | ||
| 417 | for (i = 0; i < len; i++) { | |
| 418 | if (!g_ascii_isdigit(l[i])) | |
| 419 | continue; | |
| 420 | return strtol(l + i, NULL, 10); | |
| 421 | } | |
| 422 | return 0; | |
| 423 | } | |
| 424 | ||
| 15884 | 425 | static gssize yahoo_xfer_read(guchar **buffer, PurpleXfer *xfer) |
| 7651 | 426 | { |
| 7710 | 427 | gchar buf[4096]; |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12143
diff
changeset
|
428 | gssize len; |
| 7651 | 429 | gchar *start = NULL; |
| 430 | gchar *length; | |
| 431 | gchar *end; | |
| 7710 | 432 | int filelen; |
| 7651 | 433 | struct yahoo_xfer_data *xd = xfer->data; |
| 434 | ||
| 15884 | 435 | if (purple_xfer_get_type(xfer) != PURPLE_XFER_RECEIVE) { |
| 7651 | 436 | return 0; |
| 437 | } | |
| 438 | ||
| 439 | len = read(xfer->fd, buf, sizeof(buf)); | |
| 440 | ||
| 7682 | 441 | if (len <= 0) { |
| 15884 | 442 | if ((purple_xfer_get_size(xfer) > 0) && |
| 443 | (purple_xfer_get_bytes_sent(xfer) >= purple_xfer_get_size(xfer))) { | |
| 444 | purple_xfer_set_completed(xfer, TRUE); | |
| 9798 | 445 | return 0; |
| 446 | } else | |
| 447 | return -1; | |
| 7651 | 448 | } |
| 449 | ||
| 450 | if (!xd->started) { | |
| 451 | xd->rxqueue = g_realloc(xd->rxqueue, len + xd->rxlen); | |
| 452 | memcpy(xd->rxqueue + xd->rxlen, buf, len); | |
| 453 | xd->rxlen += len; | |
| 454 | ||
| 455 | length = g_strstr_len(xd->rxqueue, len, "Content-length:"); | |
|
10579
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
456 | /* some proxies re-write this header, changing the capitalization :( |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
457 | * technically that's allowed since headers are case-insensitive |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
458 | * [RFC 2616, section 4.2] */ |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
459 | if (length == NULL) |
|
f4576b2e0956
[gaim-migrate @ 11976]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10576
diff
changeset
|
460 | length = g_strstr_len(xd->rxqueue, len, "Content-Length:"); |
| 7651 | 461 | if (length) { |
| 462 | end = g_strstr_len(length, length - xd->rxqueue, "\r\n"); | |
| 463 | if (!end) | |
| 464 | return 0; | |
| 7710 | 465 | if ((filelen = calculate_length(length, len - (length - xd->rxqueue)))) |
| 15884 | 466 | purple_xfer_set_size(xfer, filelen); |
| 7651 | 467 | } |
| 468 | start = g_strstr_len(xd->rxqueue, len, "\r\n\r\n"); | |
| 469 | if (start) | |
| 470 | start += 4; | |
| 471 | if (!start || start > (xd->rxqueue + len)) | |
| 472 | return 0; | |
| 473 | xd->started = TRUE; | |
| 474 | ||
| 475 | len -= (start - xd->rxqueue); | |
| 476 | ||
| 477 | *buffer = g_malloc(len); | |
| 478 | memcpy(*buffer, start, len); | |
| 479 | g_free(xd->rxqueue); | |
| 480 | xd->rxqueue = NULL; | |
| 481 | xd->rxlen = 0; | |
| 482 | } else { | |
| 483 | *buffer = g_malloc(len); | |
| 484 | memcpy(*buffer, buf, len); | |
| 485 | } | |
| 486 | ||
| 487 | return len; | |
| 488 | } | |
| 489 | ||
| 15884 | 490 | static gssize yahoo_xfer_write(const guchar *buffer, size_t size, PurpleXfer *xfer) |
| 7651 | 491 | { |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12143
diff
changeset
|
492 | gssize len; |
| 7651 | 493 | struct yahoo_xfer_data *xd = xfer->data; |
| 494 | ||
| 495 | if (!xd) | |
| 9798 | 496 | return -1; |
| 7651 | 497 | |
| 15884 | 498 | if (purple_xfer_get_type(xfer) != PURPLE_XFER_SEND) { |
| 9798 | 499 | return -1; |
| 7651 | 500 | } |
| 501 | ||
| 502 | len = write(xfer->fd, buffer, size); | |
| 503 | ||
| 7710 | 504 | if (len == -1) { |
| 15884 | 505 | if (purple_xfer_get_bytes_sent(xfer) >= purple_xfer_get_size(xfer)) |
| 506 | purple_xfer_set_completed(xfer, TRUE); | |
| 7710 | 507 | if ((errno != EAGAIN) && (errno != EINTR)) |
| 9798 | 508 | return -1; |
| 7710 | 509 | return 0; |
| 510 | } | |
| 511 | ||
| 15884 | 512 | if ((purple_xfer_get_bytes_sent(xfer) + len) >= purple_xfer_get_size(xfer)) |
| 513 | purple_xfer_set_completed(xfer, TRUE); | |
| 7651 | 514 | |
| 515 | return len; | |
| 516 | } | |
| 517 | ||
| 15884 | 518 | static void yahoo_xfer_cancel_send(PurpleXfer *xfer) |
| 7651 | 519 | { |
| 520 | struct yahoo_xfer_data *xfer_data; | |
| 521 | ||
| 522 | xfer_data = xfer->data; | |
| 523 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
524 | 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
|
525 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
526 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
527 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
528 | 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
|
529 | 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
|
530 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
531 | 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
|
532 | 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
|
533 | 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
|
534 | 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
|
535 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
536 | 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
|
537 | YAHOO_STATUS_DISCONNECTED, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
538 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
539 | 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
|
540 | 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
|
541 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
542 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
543 | 66, -1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
544 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
545 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
546 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
547 | 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
|
548 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
549 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
550 | 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
|
551 | 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
|
552 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
553 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
554 | 222, 2); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
555 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
556 | 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
|
557 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
558 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
559 | |
| 7651 | 560 | if (xfer_data) |
| 561 | yahoo_xfer_data_free(xfer_data); | |
| 562 | xfer->data = NULL; | |
| 563 | } | |
| 564 | ||
| 15884 | 565 | static void yahoo_xfer_cancel_recv(PurpleXfer *xfer) |
| 7651 | 566 | { |
| 567 | struct yahoo_xfer_data *xfer_data; | |
| 568 | ||
| 569 | xfer_data = xfer->data; | |
| 570 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
571 | 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
|
572 | { |
|
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 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
575 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
576 | 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
|
577 | 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
|
578 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
579 | 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
|
580 | 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
|
581 | 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
|
582 | 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
|
583 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
584 | 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
|
585 | YAHOO_STATUS_AVAILABLE, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
586 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
587 | 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
|
588 | 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
|
589 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
590 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
591 | 222, 4); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
592 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
593 | else |
|
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 | 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
|
596 | YAHOO_STATUS_DISCONNECTED, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
597 | yd->session_id); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
598 | 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
|
599 | 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
|
600 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
601 | 265, xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
602 | 66, -1); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
603 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
604 | 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
|
605 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
606 | |
|
22201
434114a12ae4
Revert patch that added receive-only transfer support for Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21918
diff
changeset
|
607 | if (xfer_data) |
| 7651 | 608 | yahoo_xfer_data_free(xfer_data); |
| 609 | xfer->data = NULL; | |
| 610 | } | |
| 611 | ||
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
612 | 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
|
613 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
614 | 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
|
615 | PurpleXfer *xfer = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
616 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
617 | 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
|
618 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
619 | 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
|
620 | 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
|
621 | && 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
|
622 | && 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
|
623 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
624 | /* 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
|
625 | 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
|
626 | 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
|
627 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
628 | 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
|
629 | 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
|
630 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
631 | 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
|
632 | 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
|
633 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
634 | /* 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
|
635 | 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
|
636 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
637 | gchar* filename; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
638 | long filesize; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
639 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
640 | 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
|
641 | 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
|
642 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
643 | 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
|
644 | 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
|
645 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
646 | /* 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
|
647 | 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
|
648 | 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
|
649 | 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
|
650 | 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
|
651 | 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
|
652 | 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
|
653 | 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
|
654 | 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
|
655 | 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
|
656 | 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
|
657 | 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
|
658 | 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
|
659 | 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
|
660 | 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
|
661 | xfer_data->txbuf_written = 0; |
|
22206
bb119c007a45
Fix a couple compile warnings.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22204
diff
changeset
|
662 | xfer_data->tx_handler = 0; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
663 | 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
|
664 | 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
|
665 | 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
|
666 | 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
|
667 | 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
|
668 | 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
|
669 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
670 | /* 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
|
671 | 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
|
672 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
673 | /* 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
|
674 | 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
|
675 | |
|
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 | if (xfer) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
678 | /* 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
|
679 | 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
|
680 | 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
|
681 | 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
|
682 | 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
|
683 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
684 | 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
|
685 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
686 | /* 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
|
687 | 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
|
688 | 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
|
689 | 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
|
690 | 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
|
691 | 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
|
692 | 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
|
693 | 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
|
694 | 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
|
695 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
696 | /* update map to current xfer */ |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
697 | g_hash_table_remove(yd->xfer_peer_idstring_map, xfer_data->xfer_peer_idstring); |
|
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
698 | g_hash_table_insert(yd->xfer_peer_idstring_map, xfer_data->xfer_peer_idstring, xfer); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
699 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
700 | /* 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
|
701 | 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
|
702 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
703 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
704 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
705 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
706 | if (xfer_data) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
707 | 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
|
708 | 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
|
709 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
710 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
711 | |
| 15884 | 712 | void yahoo_process_p2pfilexfer(PurpleConnection *gc, struct yahoo_packet *pkt) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
713 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
714 | GSList *l = pkt->hash; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
715 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
716 | char *me = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
717 | char *from = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
718 | char *service = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
719 | char *message = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
720 | char *command = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
721 | char *imv = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
722 | char *unknown = NULL; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
723 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
724 | /* Get all the necessary values from this new packet */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
725 | while(l != NULL) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
726 | { |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
727 | struct yahoo_pair *pair = l->data; |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
728 | |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
729 | switch(pair->key) { |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
730 | case 5: /* Get who the packet is for */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
731 | me = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
732 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
733 | case 4: /* Get who the packet is from */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
734 | from = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
735 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
736 | case 49: /* Get the type of service */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
737 | service = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
738 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
739 | case 14: /* Get the 'message' of the packet */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
740 | message = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
741 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
742 | case 13: /* Get the command associated with this packet */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
743 | command = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
744 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
745 | case 63: /* IMVironment name and version */ |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
746 | imv = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
747 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
748 | 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
|
749 | 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
|
750 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
751 | } |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
752 | |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
753 | l = l->next; |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
754 | } |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
755 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
756 | /* If this packet is an IMVIRONMENT, handle it accordingly */ |
|
13459
c20f00df92e5
[gaim-migrate @ 15833]
Daniel Atallah <datallah@pidgin.im>
parents:
13277
diff
changeset
|
757 | if(service != NULL && imv != NULL && !strcmp(service, "IMVIRONMENT")) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
758 | { |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
759 | /* 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
|
760 | if(strstr(imv, "doodle;") != NULL) |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
761 | yahoo_doodle_process(gc, me, from, command, message, imv); |
|
11644
939411169d01
[gaim-migrate @ 13922]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11475
diff
changeset
|
762 | |
|
11801
c19b37ac661b
[gaim-migrate @ 14092]
Gary Kramlich <grim@reaperworld.com>
parents:
11644
diff
changeset
|
763 | /* 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
|
764 | if(!strcmp(imv, ";0")) |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
765 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
766 | /* 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
|
767 | yahoo_doodle_command_got_shutdown(gc, from); |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
768 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
769 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
770 | } |
|
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11159
diff
changeset
|
771 | |
| 15884 | 772 | void yahoo_process_filetransfer(PurpleConnection *gc, struct yahoo_packet *pkt) |
| 7651 | 773 | { |
| 774 | char *from = NULL; | |
| 775 | char *to = NULL; | |
| 776 | char *msg = NULL; | |
| 777 | char *url = NULL; | |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
778 | char *imv = NULL; |
| 7651 | 779 | long expires = 0; |
| 15884 | 780 | PurpleXfer *xfer; |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
781 | struct yahoo_data *yd; |
| 7651 | 782 | struct yahoo_xfer_data *xfer_data; |
| 783 | char *service = NULL; | |
| 784 | char *filename = NULL; | |
| 785 | unsigned long filesize = 0L; | |
| 786 | GSList *l; | |
| 787 | ||
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
788 | yd = gc->proto_data; |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
789 | |
| 7651 | 790 | for (l = pkt->hash; l; l = l->next) { |
| 791 | struct yahoo_pair *pair = l->data; | |
| 792 | ||
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
793 | switch (pair->key) { |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
794 | case 4: |
| 7651 | 795 | from = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
796 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
797 | case 5: |
| 7651 | 798 | to = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
799 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
800 | case 14: |
| 7651 | 801 | msg = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
802 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
803 | case 20: |
| 7651 | 804 | url = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
805 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
806 | case 38: |
| 7651 | 807 | expires = strtol(pair->value, NULL, 10); |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
808 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
809 | case 27: |
| 7651 | 810 | filename = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
811 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
812 | case 28: |
| 7651 | 813 | filesize = atol(pair->value); |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
814 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
815 | case 49: |
| 7651 | 816 | service = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
817 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
818 | case 63: |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
819 | imv = pair->value; |
|
20150
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
820 | break; |
|
760aa4bea7c6
applied changes from 80e3a515775c28b61c4c155c4a524374ef3360ff
Richard Laager <rlaager@pidgin.im>
parents:
20044
diff
changeset
|
821 | } |
|
13851
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
822 | } |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
823 | |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
824 | /* |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
825 | * The remote user has changed their IMVironment. We |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
826 | * record it for later use. |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
827 | */ |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
828 | if (from && imv && service && (strcmp("IMVIRONMENT", service) == 0)) { |
|
27bc39ea07f8
[gaim-migrate @ 16306]
Mark Doliner <markdoliner@pidgin.im>
parents:
13713
diff
changeset
|
829 | 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
|
830 | return; |
| 7651 | 831 | } |
| 832 | ||
| 833 | if (pkt->service == YAHOO_SERVICE_P2PFILEXFER) { | |
| 10261 | 834 | if (service && (strcmp("FILEXFER", service) != 0)) { |
| 15884 | 835 | purple_debug_misc("yahoo", "unhandled service 0x%02x\n", pkt->service); |
| 7651 | 836 | return; |
| 837 | } | |
| 838 | } | |
| 839 | ||
| 840 | if (msg) { | |
| 841 | char *tmp; | |
| 842 | tmp = strchr(msg, '\006'); | |
| 843 | if (tmp) | |
| 844 | *tmp = '\0'; | |
| 845 | } | |
| 846 | ||
| 847 | if (!url || !from) | |
| 848 | return; | |
| 849 | ||
| 850 | /* Setup the Yahoo-specific file transfer data */ | |
| 851 | xfer_data = g_new0(struct yahoo_xfer_data, 1); | |
| 852 | xfer_data->gc = gc; | |
| 15884 | 853 | if (!purple_url_parse(url, &(xfer_data->host), &(xfer_data->port), &(xfer_data->path), NULL, NULL)) { |
| 7651 | 854 | g_free(xfer_data); |
| 855 | return; | |
| 856 | } | |
| 857 | ||
| 15884 | 858 | purple_debug_misc("yahoo_filexfer", "Host is %s, port is %d, path is %s, and the full url was %s.\n", |
| 7651 | 859 | xfer_data->host, xfer_data->port, xfer_data->path, url); |
| 860 | ||
| 861 | /* Build the file transfer handle. */ | |
| 15884 | 862 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_RECEIVE, from); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
863 | if (xfer) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
864 | { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
865 | xfer->data = xfer_data; |
| 7651 | 866 | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
867 | /* Set the info about the incoming file. */ |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
868 | if (filename) { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
869 | char *utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
| 15884 | 870 | purple_xfer_set_filename(xfer, utf8_filename); |
|
10976
96153d16e808
[gaim-migrate @ 12802]
Daniel Atallah <datallah@pidgin.im>
parents:
10937
diff
changeset
|
871 | g_free(utf8_filename); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
872 | } else { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
873 | gchar *start, *end; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
874 | start = g_strrstr(xfer_data->path, "/"); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
875 | if (start) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
876 | start++; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
877 | end = g_strrstr(xfer_data->path, "?"); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
878 | if (start && *start && end) { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
879 | char *utf8_filename; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
880 | filename = g_strndup(start, end - start); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
881 | utf8_filename = yahoo_string_decode(gc, filename, TRUE); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
882 | g_free(filename); |
| 15884 | 883 | purple_xfer_set_filename(xfer, utf8_filename); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
884 | g_free(utf8_filename); |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
885 | filename = NULL; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
886 | } |
| 7651 | 887 | } |
| 888 | ||
| 15884 | 889 | purple_xfer_set_size(xfer, filesize); |
| 7651 | 890 | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
891 | /* Setup our I/O op functions */ |
| 15884 | 892 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init); |
| 893 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); | |
| 894 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); | |
| 895 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); | |
| 896 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); | |
| 897 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); | |
| 898 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); | |
|
15345
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 | /* Now perform the request */ |
| 15884 | 901 | purple_xfer_request(xfer); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
902 | } |
| 7651 | 903 | } |
| 904 | ||
| 15884 | 905 | PurpleXfer *yahoo_new_xfer(PurpleConnection *gc, const char *who) |
| 7651 | 906 | { |
| 15884 | 907 | PurpleXfer *xfer; |
| 7651 | 908 | 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
|
909 | |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
910 | 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
|
911 | |
| 7651 | 912 | xfer_data = g_new0(struct yahoo_xfer_data, 1); |
| 913 | 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
|
914 | |
| 7651 | 915 | /* Build the file transfer handle. */ |
| 15884 | 916 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who); |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
917 | if (xfer) |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
918 | { |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
919 | xfer->data = xfer_data; |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
920 | |
|
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
921 | /* Setup our I/O op functions */ |
| 15884 | 922 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init); |
| 923 | purple_xfer_set_start_fnc(xfer, yahoo_xfer_start); | |
| 924 | purple_xfer_set_end_fnc(xfer, yahoo_xfer_end); | |
| 925 | purple_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); | |
| 926 | purple_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); | |
| 927 | purple_xfer_set_read_fnc(xfer, yahoo_xfer_read); | |
| 928 | purple_xfer_set_write_fnc(xfer, yahoo_xfer_write); | |
|
15345
797936e968ff
[gaim-migrate @ 18073]
Evan Schoenberg <evands@pidgin.im>
parents:
14899
diff
changeset
|
929 | } |
| 7651 | 930 | |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
931 | return xfer; |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
932 | } |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
933 | |
|
22323
ef5a1f7861b4
Kill this warning when using -Wstrict-prototypes:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22206
diff
changeset
|
934 | static gchar* yahoo_xfer_new_xfer_id(void) |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
935 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
936 | gchar *ans; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
937 | int i,j; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
938 | 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
|
939 | ans[23] = '$'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
940 | ans[22] = '$'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
941 | 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
|
942 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
943 | 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
|
944 | if(j < 26) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
945 | 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
|
946 | 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
|
947 | 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
|
948 | else |
|
22323
ef5a1f7861b4
Kill this warning when using -Wstrict-prototypes:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22206
diff
changeset
|
949 | ans[i] = j - 52 + '0'; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
950 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
951 | return ans; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
952 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
953 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
954 | 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
|
955 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
956 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
957 | 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
|
958 | 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
|
959 | 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
|
960 | long actaddr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
961 | 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
|
962 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
963 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
964 | 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
|
965 | gchar *url; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
966 | gchar *filename; |
|
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 | if (!(xfer = data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
969 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
970 | 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
|
971 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
972 | gc = xd->gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
973 | 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
|
974 | 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
|
975 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
976 | if(!hosts) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
977 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
978 | 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
|
979 | 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
|
980 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
981 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
982 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
983 | /* Discard the length... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
984 | 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
|
985 | if(!hosts) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
986 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
987 | 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
|
988 | 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
|
989 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
990 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
991 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
992 | /* TODO:actually, u must try with addr no.1 , if its not working addr no.2 ..... */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
993 | addr = hosts->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
994 | 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
|
995 | d = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
996 | 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
|
997 | c = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
998 | 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
|
999 | b = actaddr % 256; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1000 | 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
|
1001 | a = actaddr; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1002 | if(yd->jp) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1003 | 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
|
1004 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1005 | 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
|
1006 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1007 | 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
|
1008 | 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
|
1009 | purple_xfer_cancel_remote(xfer); |
| 22966 | 1010 | g_free(url); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1011 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1012 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1013 | g_free(url); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1014 | /* Free the address... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1015 | 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
|
1016 | 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
|
1017 | addr = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1018 | while (hosts != NULL) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1019 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1020 | /* Discard the length... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1021 | 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
|
1022 | /* Free the address... */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1023 | 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
|
1024 | 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
|
1025 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1026 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1027 | 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
|
1028 | 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
|
1029 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1030 | 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
|
1031 | 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
|
1032 | 5, xfer->who, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1033 | 265, xd->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1034 | 27, filename, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1035 | 249, 3, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1036 | 250, xd->host); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1037 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1038 | g_free(filename); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1039 | 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
|
1040 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1041 | |
| 15884 | 1042 | 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
|
1043 | { |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1044 | struct yahoo_xfer_data *xfer_data; |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1045 | struct yahoo_data *yd = gc->proto_data; |
| 15884 | 1046 | PurpleXfer *xfer = yahoo_new_xfer(gc, who); |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1047 | |
|
12143
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1048 | g_return_if_fail(xfer != NULL); |
|
09f216663302
[gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents:
11914
diff
changeset
|
1049 | |
|
26351
cb7bb2f504d6
When sending a file, if there isn't a p2p connection, try establishing it.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26344
diff
changeset
|
1050 | /* if we don't have a p2p connection, try establishing it now */ |
|
cb7bb2f504d6
When sending a file, if there isn't a p2p connection, try establishing it.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26344
diff
changeset
|
1051 | if( !g_hash_table_lookup(yd->peers, who) ) |
|
cb7bb2f504d6
When sending a file, if there isn't a p2p connection, try establishing it.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26344
diff
changeset
|
1052 | yahoo_send_p2p_pkt(gc, who, 0); |
|
cb7bb2f504d6
When sending a file, if there isn't a p2p connection, try establishing it.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26344
diff
changeset
|
1053 | |
|
26343
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1054 | xfer_data = xfer->data; |
|
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1055 | xfer_data->status_15 = STARTED; |
|
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1056 | purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15); |
|
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1057 | xfer_data->version = 15; |
|
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1058 | xfer_data->xfer_peer_idstring = yahoo_xfer_new_xfer_id(); |
|
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1059 | g_hash_table_insert(yd->xfer_peer_idstring_map, xfer_data->xfer_peer_idstring, xfer); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1060 | |
| 7651 | 1061 | /* Now perform the request */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11897
diff
changeset
|
1062 | if (file) |
| 15884 | 1063 | purple_xfer_request_accepted(xfer, file); |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9306
diff
changeset
|
1064 | else |
| 15884 | 1065 | purple_xfer_request(xfer); |
| 7651 | 1066 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1067 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1068 | static void yahoo_p2p_ft_server_listen_cb(int listenfd, gpointer data); /* using this in yahoo_xfer_send_cb_15 */ |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1069 | static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message);/* using this in recv_cb */ |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1070 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1071 | 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
|
1072 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1073 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1074 | 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
|
1075 | int did; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1076 | gchar* buf; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1077 | gchar* t; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1078 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1079 | PurpleConnection *gc; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1080 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1081 | xfer = data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1082 | xd = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1083 | 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
|
1084 | gc = xd->gc; |
|
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 | 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
|
1087 | 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
|
1088 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1089 | xd->txbuflen += did; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1090 | buf[did] = '\0'; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1091 | t = xd->txbuf; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1092 | 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
|
1093 | g_free(t); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1094 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1095 | g_free(buf); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1096 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1097 | 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
|
1098 | 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
|
1099 | 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
|
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 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1102 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1103 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1104 | 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
|
1105 | 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
|
1106 | xd->txbuflen = 0; |
|
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 | 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
|
1109 | xd->status_15 = HEAD_REPLY_RECEIVED; |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1110 | close(source);/* Is this required? */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1111 | 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
|
1112 | xd->txbuf = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1113 | 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
|
1114 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1115 | 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
|
1116 | _("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
|
1117 | 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
|
1118 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1119 | } else { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1120 | 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
|
1121 | 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
|
1122 | xd->status_15); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1123 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1124 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1125 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1126 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1127 | 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
|
1128 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1129 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1130 | 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
|
1131 | int remaining, written; |
|
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 | xfer = data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1134 | xd = xfer->data; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1135 | 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
|
1136 | 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
|
1137 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1138 | 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
|
1139 | written = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1140 | 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
|
1141 | 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
|
1142 | 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
|
1143 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1144 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1145 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1146 | if (written < remaining) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1147 | 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
|
1148 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1149 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1150 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1151 | 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
|
1152 | 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
|
1153 | 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
|
1154 | xd->txbuf = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1155 | xd->txbuflen = 0; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1156 | 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
|
1157 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1158 | if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE && xd->status_15 == STARTED) |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1159 | { |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1160 | 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
|
1161 | 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
|
1162 | 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
|
1163 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1164 | 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
|
1165 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1166 | 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
|
1167 | xfer->fd = source; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1168 | 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
|
1169 | } |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1170 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND && (xd->status_15 == ACCEPTED || xd->status_15 == P2P_GET_REQUESTED) ) |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1171 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1172 | 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
|
1173 | xfer->fd = source; |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1174 | /* Remove Read event */ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1175 | purple_input_remove(xd->input_event); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1176 | xd->input_event = 0; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1177 | 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
|
1178 | } |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1179 | else if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND && xd->status_15 == P2P_HEAD_REQUESTED) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1180 | { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1181 | xd->status_15 = P2P_HEAD_REPLIED; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1182 | /* Remove Read event and close descriptor */ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1183 | purple_input_remove(xd->input_event); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1184 | xd->input_event = 0; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1185 | close(source); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1186 | xfer->fd = -1; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1187 | /* start local server, listen for connections */ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1188 | purple_network_listen(xd->yahoo_local_p2p_ft_server_port, SOCK_STREAM, yahoo_p2p_ft_server_listen_cb, xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1189 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1190 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1191 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1192 | 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
|
1193 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1194 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1195 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1196 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1197 | 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
|
1198 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1199 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1200 | 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
|
1201 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1202 | 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
|
1203 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1204 | if (!(xfer = data)) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1205 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1206 | 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
|
1207 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1208 | 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
|
1209 | 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
|
1210 | 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
|
1211 | 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
|
1212 | 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
|
1213 | 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
|
1214 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1215 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1216 | /* 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
|
1217 | 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
|
1218 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1219 | gchar* cookies; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1220 | 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
|
1221 | 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
|
1222 | { |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1223 | if(xd->info_val_249 == 2) |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1224 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1225 | /* sending file via p2p, we are connected as client */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1226 | xd->txbuf = g_strdup_printf("POST /%s HTTP/1.1\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", |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1227 | xd->path, |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1228 | xd->host, |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1229 | (long int)xfer->size); /* to do, add Referer */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1230 | } |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1231 | else |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1232 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1233 | /* sending file via relaying */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1234 | 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", |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1235 | 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
|
1236 | 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
|
1237 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1238 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1239 | xd->host, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1240 | (long int)xfer->size); |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1241 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1242 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1243 | 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
|
1244 | { |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1245 | if(xd->info_val_249 == 1) |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1246 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1247 | /* receiving file via p2p, connected as client */ |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1248 | xd->txbuf = g_strdup_printf("HEAD /%s HTTP/1.1\r\nAccept:*/*\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",xd->path,xd->host); |
|
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1249 | } |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1250 | else |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1251 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1252 | /* receiving file via relaying */ |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1253 | 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", |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1254 | 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
|
1255 | 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
|
1256 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1257 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1258 | xd->host); |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1259 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1260 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1261 | 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
|
1262 | { |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1263 | if(xd->info_val_249 == 1) |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1264 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1265 | /* receiving file via p2p, connected as client */ |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1266 | xd->txbuf = g_strdup_printf("GET /%s HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\nHost: %s\r\nConnection: Keep-Alive\r\n\r\n",xd->path,xd->host); |
|
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1267 | } |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1268 | else |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1269 | { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1270 | /* receiving file via relaying */ |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1271 | 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", |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1272 | 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
|
1273 | 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
|
1274 | xfer->who, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1275 | cookies, |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1276 | xd->host); |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1277 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1278 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1279 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1280 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1281 | 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
|
1282 | g_free(cookies); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1283 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1284 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1285 | 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
|
1286 | 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
|
1287 | g_free(cookies); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1288 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1289 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1290 | 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
|
1291 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1292 | 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
|
1293 | 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
|
1294 | 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
|
1295 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1296 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1297 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1298 | static void yahoo_p2p_ft_POST_cb(gpointer data, gint source, PurpleInputCondition cond) |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1299 | { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1300 | PurpleXfer *xfer; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1301 | struct yahoo_xfer_data *xd; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1302 | |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1303 | xfer = data; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1304 | if (!(xd = xfer->data)) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1305 | purple_input_remove(xd->input_event); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1306 | purple_xfer_cancel_remote(xfer); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1307 | return; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1308 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1309 | |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1310 | purple_input_remove(xd->input_event); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1311 | xd->status_15 = TRANSFER_PHASE; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1312 | xfer->fd = source; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1313 | purple_xfer_start(xfer, source, NULL, 0); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1314 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1315 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1316 | static void yahoo_p2p_ft_HEAD_GET_cb(gpointer data, gint source, PurpleInputCondition cond) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1317 | { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1318 | PurpleXfer *xfer; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1319 | struct yahoo_xfer_data *xd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1320 | guchar buf[1024]; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1321 | int len; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1322 | char *url_head; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1323 | char *url_get; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1324 | time_t unix_time; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1325 | char *time_str; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1326 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1327 | xfer = data; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1328 | if (!(xd = xfer->data)) { |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1329 | purple_input_remove(xd->input_event); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1330 | purple_xfer_cancel_remote(xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1331 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1332 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1333 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1334 | len = read(source, buf, sizeof(buf)); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1335 | if ((len < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1336 | return ; /* No Worries*/ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1337 | else if (len <= 0) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1338 | purple_debug_warning("yahoo","p2p-ft: Error in connection, or host disconnected\n"); |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1339 | purple_input_remove(xd->input_event); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1340 | purple_xfer_cancel_remote(xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1341 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1342 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1343 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1344 | url_head = g_strdup_printf("HEAD %s", xd->xfer_url); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1345 | url_get = g_strdup_printf("GET %s", xd->xfer_url); |
|
23687
c8b96ad9c946
Add + in place of spaces in p2p url, fixes transfer of file with name containing spaces
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23686
diff
changeset
|
1346 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1347 | if( strncmp(url_head, (char *)buf, strlen(url_head)) == 0 ) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1348 | xd->status_15 = P2P_HEAD_REQUESTED; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1349 | else if( strncmp(url_get, (char *)buf, strlen(url_get)) == 0 ) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1350 | xd->status_15 = P2P_GET_REQUESTED; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1351 | else { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1352 | purple_debug_warning("yahoo","p2p-ft: Wrong HEAD/GET request from peer, disconnecting host\n"); |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1353 | purple_input_remove(xd->input_event); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1354 | purple_xfer_cancel_remote(xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1355 | g_free(url_head); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1356 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1357 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1358 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1359 | unix_time = time(NULL); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1360 | time_str = ctime(&unix_time); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1361 | strcpy(time_str + strlen(time_str) - 1, "\0"); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1362 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1363 | if (xd->txbuflen == 0) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1364 | xd->txbuf = g_strdup_printf("HTTP/1.0 200 OK\r\nDate: %s GMT\r\nServer: Y!/1.0\r\nMIME-version: 1.0\r\nLast-modified: %s GMT\r\nContent-length: %d\r\n\r\n", time_str, time_str, xfer->size); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1365 | xd->txbuflen = strlen(xd->txbuf); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1366 | xd->txbuf_written = 0; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1367 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1368 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1369 | if (!xd->tx_handler) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1370 | xd->tx_handler = purple_input_add(source, PURPLE_INPUT_WRITE, yahoo_xfer_send_cb_15, xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1371 | yahoo_xfer_send_cb_15(xfer, source, PURPLE_INPUT_WRITE); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1372 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1373 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1374 | g_free(url_head); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1375 | g_free(url_get); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1376 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1377 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1378 | static void yahoo_p2p_ft_server_send_connected_cb(gpointer data, gint source, PurpleInputCondition cond) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1379 | { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1380 | int acceptfd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1381 | PurpleXfer *xfer; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1382 | struct yahoo_xfer_data *xd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1383 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1384 | xfer = data; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1385 | if (!(xd = xfer->data)) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1386 | purple_xfer_cancel_remote(xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1387 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1388 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1389 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1390 | acceptfd = accept(source, NULL, 0); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1391 | if(acceptfd == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1392 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1393 | else if(acceptfd == -1) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1394 | purple_debug_warning("yahoo","yahoo_p2p_server_send_connected_cb: accept: %s\n", g_strerror(errno)); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1395 | purple_xfer_cancel_remote(xfer); |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1396 | /* remove watcher and close p2p ft server */ |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1397 | purple_input_remove(xd->yahoo_p2p_ft_server_watcher); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1398 | close(xd->yahoo_local_p2p_ft_server_fd); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1399 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1400 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1401 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1402 | /* remove watcher and close p2p ft server */ |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1403 | purple_input_remove(xd->yahoo_p2p_ft_server_watcher); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1404 | close(xd->yahoo_local_p2p_ft_server_fd); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1405 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1406 | /* Add an Input Read event to the file descriptor */ |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1407 | xfer->fd = acceptfd; |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1408 | if(xfer->type == PURPLE_XFER_RECEIVE) |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1409 | xd->input_event = purple_input_add(acceptfd, PURPLE_INPUT_READ, yahoo_p2p_ft_POST_cb, data); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1410 | else |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1411 | xd->input_event = purple_input_add(acceptfd, PURPLE_INPUT_READ, yahoo_p2p_ft_HEAD_GET_cb, data); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1412 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1413 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1414 | static void yahoo_p2p_ft_server_listen_cb(int listenfd, gpointer data) |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1415 | { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1416 | PurpleXfer *xfer; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1417 | struct yahoo_xfer_data *xd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1418 | struct yahoo_packet *pkt; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1419 | PurpleAccount *account; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1420 | struct yahoo_data *yd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1421 | gchar *filename; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1422 | const char *local_ip; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1423 | gchar *url_to_send = NULL; |
|
23687
c8b96ad9c946
Add + in place of spaces in p2p url, fixes transfer of file with name containing spaces
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23686
diff
changeset
|
1424 | char *filename_without_spaces = NULL; |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1425 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1426 | xfer = data; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1427 | if ( !( (xd = xfer->data) || (listenfd != -1) ) ) { |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1428 | purple_debug_warning("yahoo","p2p: error starting server for p2p file transfer\n"); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1429 | purple_xfer_cancel_remote(xfer); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1430 | return; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1431 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1432 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1433 | if( (xfer->type == PURPLE_XFER_RECEIVE) || (xd->status_15 != P2P_HEAD_REPLIED) ) { |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1434 | yd = xd->gc->proto_data; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1435 | account = purple_connection_get_account(xd->gc); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1436 | local_ip = purple_network_get_my_ip(listenfd); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1437 | xd->yahoo_local_p2p_ft_server_port = purple_network_get_port_from_fd(listenfd); |
|
23687
c8b96ad9c946
Add + in place of spaces in p2p url, fixes transfer of file with name containing spaces
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23686
diff
changeset
|
1438 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1439 | filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); |
|
26344
a0af8ddd60e2
Use purple_util_chrreplace instead of g_strsplit then g_strjoinv
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26343
diff
changeset
|
1440 | filename_without_spaces = g_strdup(filename); |
|
a0af8ddd60e2
Use purple_util_chrreplace instead of g_strsplit then g_strjoinv
Sulabh Mahajan <sulabh@pidgin.im>
parents:
26343
diff
changeset
|
1441 | purple_util_chrreplace(filename_without_spaces, ' ', '+'); |
|
23687
c8b96ad9c946
Add + in place of spaces in p2p url, fixes transfer of file with name containing spaces
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23686
diff
changeset
|
1442 | xd->xfer_url = g_strdup_printf("/Messenger.%s.%d000%s?AppID=Messenger&UserID=%s&K=lc9lu2u89gz1llmplwksajkjx", xfer->who, (int)time(NULL), filename_without_spaces, xfer->who); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1443 | url_to_send = g_strdup_printf("http://%s:%d%s", local_ip, xd->yahoo_local_p2p_ft_server_port, xd->xfer_url); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1444 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1445 | if(xfer->type == PURPLE_XFER_RECEIVE) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1446 | xd->info_val_249 = 2; /* 249=2: we are p2p server, and receiving file */ |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1447 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_ACC_15, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1448 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1449 | yahoo_packet_hash(pkt, "ssssis", |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1450 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1451 | 5, xfer->who, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1452 | 265, xd->xfer_peer_idstring, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1453 | 27, xfer->filename, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1454 | 249, 2, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1455 | 250, url_to_send); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1456 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1457 | else { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1458 | xd->info_val_249 = 1; /* 249=1: we are p2p server, and sending file */ |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1459 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1460 | yahoo_packet_hash(pkt, "ssssis", |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1461 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1462 | 5, xfer->who, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1463 | 265, xd->xfer_peer_idstring, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1464 | 27, filename, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1465 | 249, 1, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1466 | 250, url_to_send); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1467 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1468 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1469 | yahoo_packet_send_and_free(pkt, yd); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1470 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1471 | g_free(filename); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1472 | g_free(url_to_send); |
|
23687
c8b96ad9c946
Add + in place of spaces in p2p url, fixes transfer of file with name containing spaces
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23686
diff
changeset
|
1473 | g_free(filename_without_spaces); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1474 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1475 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1476 | /* Add an Input Read event to the file descriptor */ |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1477 | xd->yahoo_local_p2p_ft_server_fd = listenfd; |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1478 | xd->yahoo_p2p_ft_server_watcher = purple_input_add(listenfd, PURPLE_INPUT_READ, yahoo_p2p_ft_server_send_connected_cb, data); |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1479 | } |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1480 | |
|
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1481 | /* send (p2p) file transfer information */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1482 | static void yahoo_p2p_client_send_ft_info(PurpleConnection *gc, PurpleXfer *xfer) |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1483 | { |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1484 | struct yahoo_xfer_data *xd; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1485 | struct yahoo_packet *pkt; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1486 | PurpleAccount *account; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1487 | struct yahoo_data *yd; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1488 | gchar *filename; |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1489 | struct yahoo_p2p_data *p2p_data; |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1490 | |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1491 | if (!(xd = xfer->data)) |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1492 | return; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1493 | |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1494 | account = purple_connection_get_account(gc); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1495 | yd = gc->proto_data; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1496 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1497 | p2p_data = g_hash_table_lookup(yd->peers, xfer->who); |
|
23693
100d744dc99b
changed gboolean connection_type to enum yahoo_p2p_connection_type
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23688
diff
changeset
|
1498 | if( p2p_data->connection_type == YAHOO_P2P_WE_ARE_SERVER ) |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1499 | if(purple_network_listen_range(0, 0, SOCK_STREAM, yahoo_p2p_ft_server_listen_cb, xfer)) |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1500 | return; |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1501 | |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1502 | pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1503 | filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1504 | |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1505 | yahoo_packet_hash(pkt, "ssssi", |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1506 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1507 | 5, xfer->who, |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1508 | 265, xd->xfer_peer_idstring, |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1509 | 27, filename, |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1510 | 249, 2); /* 249=2: we are p2p client */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1511 | xd->info_val_249 = 2; |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1512 | yahoo_packet_send_and_free(pkt, yd); |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1513 | |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1514 | g_free(filename); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1515 | } |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1516 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1517 | 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
|
1518 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1519 | char *from = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1520 | char *to = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1521 | char *imv = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1522 | 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
|
1523 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1524 | 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
|
1525 | 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
|
1526 | char *service = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1527 | char *filename = NULL; |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1528 | char *xfer_peer_idstring = NULL; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1529 | 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
|
1530 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1531 | 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
|
1532 | 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
|
1533 | int nooffiles = 0; |
|
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 | 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
|
1536 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1537 | 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
|
1538 | 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
|
1539 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1540 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1541 | case 4: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1542 | from = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1543 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1544 | case 5: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1545 | to = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1546 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1547 | case 265: |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1548 | xfer_peer_idstring = pair->value; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1549 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1550 | case 27: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1551 | 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
|
1552 | nooffiles++; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1553 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1554 | case 28: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1555 | 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
|
1556 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1557 | case 222: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1558 | 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
|
1559 | /* 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
|
1560 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1561 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1562 | /* 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. */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1563 | case 49: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1564 | service = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1565 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1566 | case 63: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1567 | imv = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1568 | break; |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1569 | /* end check */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1570 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1571 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1572 | } |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1573 | if(!xfer_peer_idstring) |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1574 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1575 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1576 | 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
|
1577 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1578 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1579 | xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1580 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1581 | 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
|
1582 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1583 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1584 | 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
|
1585 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1586 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1587 | xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1588 | if(!xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1589 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1590 | /* |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1591 | * In the file trans info packet that we must reply with, we are |
|
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1592 | * supposed to mention the ip address... |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1593 | * purple connect does not give me a way of finding the ip address... |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1594 | * so, purple dnsquery is used... but retries, trying with next ip |
|
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1595 | * address etc. is not implemented..TODO |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1596 | */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1597 | |
|
23686
ea2c220b8535
Send file by p2p when we are server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23680
diff
changeset
|
1598 | /* To send through p2p */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1599 | if( g_hash_table_lookup(yd->peers, from) ) { |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1600 | /* send p2p file transfer information */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1601 | yahoo_p2p_client_send_ft_info(gc, xfer); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1602 | return; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1603 | } |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1604 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1605 | if (yd->jp) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1606 | { |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1607 | purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT, |
|
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1608 | yahoo_xfer_dns_connected_15, xfer); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1609 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1610 | else |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1611 | { |
|
22401
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1612 | purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT, |
|
5fe1761a4a15
Simplified version of the newest patch on #4533 to not try Yahoo protocol
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22323
diff
changeset
|
1613 | yahoo_xfer_dns_connected_15, xfer); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1614 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1615 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1616 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1617 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1618 | /* 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. */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1619 | /* |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1620 | * 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
|
1621 | * 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
|
1622 | */ |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1623 | 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
|
1624 | 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
|
1625 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1626 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1627 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1628 | 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
|
1629 | 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
|
1630 | 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
|
1631 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1632 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1633 | } |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1634 | /* end processing */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1635 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1636 | if(!filename_list) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1637 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1638 | /* 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
|
1639 | 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
|
1640 | 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
|
1641 | 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
|
1642 | 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
|
1643 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1644 | if(!from) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1645 | 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
|
1646 | 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
|
1647 | 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
|
1648 | xfer_data->gc = gc; |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1649 | xfer_data->xfer_peer_idstring = g_strdup(xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1650 | 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
|
1651 | 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
|
1652 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1653 | /* 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
|
1654 | 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
|
1655 | xfer->message = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1656 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1657 | if (xfer) |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1658 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1659 | /* 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
|
1660 | 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
|
1661 | 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
|
1662 | 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
|
1663 | 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
|
1664 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1665 | 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
|
1666 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1667 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1668 | /* 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
|
1669 | 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
|
1670 | 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
|
1671 | 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
|
1672 | 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
|
1673 | 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
|
1674 | 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
|
1675 | 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
|
1676 | 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
|
1677 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1678 | g_hash_table_insert(yd->xfer_peer_idstring_map, |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1679 | xfer_data->xfer_peer_idstring, |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1680 | xfer); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1681 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1682 | if(nooffiles > 1) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1683 | gchar* message; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1684 | 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
|
1685 | 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
|
1686 | g_free(message); |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1687 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1688 | /* 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
|
1689 | 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
|
1690 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1691 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1692 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1693 | 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
|
1694 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1695 | char *from = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1696 | char *to = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1697 | char *url = NULL; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1698 | 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
|
1699 | 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
|
1700 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1701 | 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
|
1702 | 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
|
1703 | char *filename = NULL; |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1704 | char *xfer_peer_idstring = NULL; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1705 | 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
|
1706 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1707 | 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
|
1708 | PurpleAccount *account; |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1709 | struct yahoo_p2p_data *p2p_data; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1710 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1711 | 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
|
1712 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1713 | 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
|
1714 | 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
|
1715 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1716 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1717 | case 4: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1718 | from = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1719 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1720 | case 5: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1721 | to = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1722 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1723 | case 265: |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1724 | xfer_peer_idstring = pair->value; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1725 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1726 | case 27: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1727 | filename = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1728 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1729 | case 66: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1730 | 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
|
1731 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1732 | case 249: |
|
23675
6c5ffe34cb35
Yahoo P2P File Transfer RECEIVE only support added.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
22966
diff
changeset
|
1733 | val_249 = strtol(pair->value, NULL, 10); |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1734 | /* 249 has value 1 or 2 when doing p2p transfer and value 3 when relaying through yahoo server */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1735 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1736 | case 250: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1737 | url = pair->value; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1738 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1739 | case 251: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1740 | 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
|
1741 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1742 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1743 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1744 | |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1745 | if(!xfer_peer_idstring) |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1746 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1747 | |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1748 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1749 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1750 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1751 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1752 | 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
|
1753 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1754 | 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
|
1755 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1756 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1757 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1758 | 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
|
1759 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1760 | 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
|
1761 | xfer_data->xfer_idstring_for_relay = g_strdup(xfer_idstring_for_relay); |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1762 | if(val_249 == 1 || val_249 == 3) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1763 | if (!purple_url_parse(url, &(xfer_data->host), &(xfer_data->port), &(xfer_data->path), NULL, NULL)) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1764 | purple_xfer_cancel_remote(xfer); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1765 | return; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1766 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1767 | |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1768 | account = purple_connection_get_account(xfer_data->gc); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1769 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1770 | pkt_to_send = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_ACC_15, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1771 | YAHOO_STATUS_AVAILABLE, yd->session_id); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1772 | yahoo_packet_hash(pkt_to_send, "ssssisi", |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1773 | 1, purple_normalize(account, purple_account_get_username(account)), |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1774 | 5, xfer->who, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1775 | 265, xfer_data->xfer_peer_idstring, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1776 | 27, xfer->filename, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1777 | 249, xfer_data->info_val_249, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1778 | 251, xfer_data->xfer_idstring_for_relay, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1779 | 222, 3); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1780 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1781 | yahoo_packet_send_and_free(pkt_to_send, yd); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1782 | |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1783 | if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port, |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1784 | yahoo_xfer_connected_15, xfer) == NULL) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1785 | purple_notify_error(gc, NULL, _("File Transfer Failed"), |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1786 | _("Unable to establish file descriptor.")); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1787 | purple_xfer_cancel_remote(xfer); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1788 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1789 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1790 | else if(val_249 == 2) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1791 | p2p_data = g_hash_table_lookup(yd->peers, xfer->who); |
|
23693
100d744dc99b
changed gboolean connection_type to enum yahoo_p2p_connection_type
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23688
diff
changeset
|
1792 | if( !( p2p_data && (p2p_data->connection_type == YAHOO_P2P_WE_ARE_SERVER) ) ) { |
|
23688
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1793 | purple_xfer_cancel_remote(xfer); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1794 | return; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1795 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1796 | if(!purple_network_listen_range(0, 0, SOCK_STREAM, yahoo_p2p_ft_server_listen_cb, xfer)) { |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1797 | purple_xfer_cancel_remote(xfer); |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1798 | return; |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1799 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1800 | } |
|
cdc6bf28417e
Receive files when we are p2p server
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23687
diff
changeset
|
1801 | } |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1802 | |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1803 | /* TODO: Check filename etc. No probs till some hacker comes in the way */ |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1804 | 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
|
1805 | { |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1806 | gchar *xfer_peer_idstring = NULL; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1807 | 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
|
1808 | PurpleXfer *xfer; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1809 | 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
|
1810 | 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
|
1811 | GSList *l; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1812 | PurpleAccount *account; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1813 | long val_66 = 0; |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1814 | gchar *url = NULL; |
|
26343
b7be84823af9
Remove check of version for file transfer, use only version 15 file transfer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23695
diff
changeset
|
1815 | int val_249 = 0; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1816 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1817 | 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
|
1818 | 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
|
1819 | 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
|
1820 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1821 | switch (pair->key) { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1822 | case 251: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1823 | 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
|
1824 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1825 | case 265: |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1826 | xfer_peer_idstring = pair->value; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1827 | break; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1828 | case 66: |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1829 | val_66 = atol(pair->value); |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1830 | break; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1831 | case 249: |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1832 | val_249 = atol(pair->value); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1833 | break; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1834 | case 250: |
|
23694
95222c637ab6
minor changes in comments style and alphabetic ordering of header files.
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23693
diff
changeset
|
1835 | url = pair->value; /* we get a p2p url here when sending file, connected as client */ |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1836 | break; |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1837 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1838 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1839 | |
|
22204
78dc320dad31
Some readability changes. Refs #4533.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22202
diff
changeset
|
1840 | xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map, xfer_peer_idstring); |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1841 | if(!xfer) return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1842 | |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1843 | if(val_66 == -1 || ( (!(xfer_idstring_for_relay)) && (val_249 != 2) )) |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1844 | { |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1845 | purple_xfer_cancel_remote(xfer); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1846 | return; |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1847 | } |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1848 | |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1849 | if( (val_249 == 2) && (!(url)) ) |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1850 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1851 | 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
|
1852 | return; |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1853 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1854 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1855 | xfer_data = xfer->data; |
|
23680
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1856 | if(url) |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1857 | purple_url_parse(url, &(xfer_data->host), &(xfer_data->port), &(xfer_data->path), NULL, NULL); |
|
619bbd7ae401
Support for P2P file transfer (SEND), when we are client to the peer
Sulabh Mahajan <sulabh@pidgin.im>
parents:
23675
diff
changeset
|
1858 | |
|
22202
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1859 | 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
|
1860 | 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
|
1861 | 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
|
1862 | |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1863 | 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
|
1864 | 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
|
1865 | { |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1866 | 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
|
1867 | 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
|
1868 | } |
|
e42ab2e3eba1
This patch from Thanumalayan S. implements Yahoo protocol version 15 file
Thanumalayan Sankaranarayanan <madthanu@gmail.com>
parents:
22201
diff
changeset
|
1869 | } |