Mercurial > gftp.yaz
annotate src/gtk/transfer.c @ 767:49cfbe02926b
2006-7-13 Brian Masney <masneyb@gftp.org>
* src/gtk/bookmarks.c src/gtk/delete_dialog.c src/gtk/dnd.c
src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/gtkui.c
src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/options_dialog.c
src/gtk/transfer.c src/gtk/view_dialog.c - fixed a few minor warnings
from splint.
author | masneyb |
---|---|
date | Fri, 14 Jul 2006 01:53:42 +0000 |
parents | 11b85ac0ec15 |
children | eeb471438232 |
rev | line source |
---|---|
1 | 1 /*****************************************************************************/ |
2 /* transfer.c - functions to handle transfering files */ | |
255 | 3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */ |
1 | 4 /* */ |
5 /* This program is free software; you can redistribute it and/or modify */ | |
6 /* it under the terms of the GNU General Public License as published by */ | |
7 /* the Free Software Foundation; either version 2 of the License, or */ | |
8 /* (at your option) any later version. */ | |
9 /* */ | |
10 /* This program is distributed in the hope that it will be useful, */ | |
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | |
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | |
13 /* GNU General Public License for more details. */ | |
14 /* */ | |
15 /* You should have received a copy of the GNU General Public License */ | |
16 /* along with this program; if not, write to the Free Software */ | |
17 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
18 /*****************************************************************************/ | |
19 | |
518 | 20 #include "gftp-gtk.h" |
33 | 21 static const char cvsid[] = "$Id$"; |
1 | 22 |
129 | 23 static int num_transfers_in_progress = 0; |
1 | 24 |
48 | 25 int |
496 | 26 ftp_list_files (gftp_window_data * wdata) |
48 | 27 { |
355 | 28 gftpui_callback_data * cdata; |
48 | 29 |
30 gtk_label_set (GTK_LABEL (wdata->hoststxt), _("Receiving file names...")); | |
31 | |
355 | 32 cdata = g_malloc0 (sizeof (*cdata)); |
33 cdata->request = wdata->request; | |
34 cdata->uidata = wdata; | |
35 cdata->run_function = gftpui_common_run_ls; | |
511 | 36 cdata->dont_refresh = 1; |
48 | 37 |
355 | 38 gftpui_common_run_callback_function (cdata); |
48 | 39 |
355 | 40 wdata->files = cdata->files; |
41 g_free (cdata); | |
48 | 42 |
43 if (wdata->files == NULL || !GFTP_IS_CONNECTED (wdata->request)) | |
44 { | |
380 | 45 gftpui_disconnect (wdata); |
48 | 46 return (0); |
47 } | |
48 | |
49 wdata->sorted = 0; | |
129 | 50 sortrows (GTK_CLIST (wdata->listbox), -1, (gpointer) wdata); |
355 | 51 |
48 | 52 if (IS_NONE_SELECTED (wdata)) |
53 gtk_clist_select_row (GTK_CLIST (wdata->listbox), 0, 0); | |
355 | 54 |
48 | 55 return (1); |
56 } | |
57 | |
58 | |
1 | 59 int |
767 | 60 ftp_connect (gftp_window_data * wdata, gftp_request * request) |
1 | 61 { |
62 if (wdata->request == request) | |
367 | 63 gtk_label_set (GTK_LABEL (wdata->hoststxt), _("Connecting...")); |
1 | 64 |
377 | 65 return (gftpui_common_cmd_open (wdata, request, NULL, NULL, NULL)); |
1 | 66 } |
67 | |
68 | |
69 void | |
70 get_files (gpointer data) | |
71 { | |
72 transfer_window_files (&window2, &window1); | |
73 } | |
74 | |
75 | |
76 void | |
77 put_files (gpointer data) | |
78 { | |
79 transfer_window_files (&window1, &window2); | |
80 } | |
81 | |
82 | |
83 void | |
84 transfer_window_files (gftp_window_data * fromwdata, gftp_window_data * towdata) | |
85 { | |
86 gftp_file * tempfle, * newfle; | |
87 GList * templist, * filelist; | |
88 gftp_transfer * transfer; | |
506 | 89 int num, ret, disconnect; |
1 | 90 |
91 if (!check_status (_("Transfer Files"), fromwdata, 1, 0, 1, | |
92 towdata->request->put_file != NULL && fromwdata->request->get_file != NULL)) | |
93 return; | |
94 | |
95 if (!GFTP_IS_CONNECTED (fromwdata->request) || | |
96 !GFTP_IS_CONNECTED (towdata->request)) | |
97 { | |
677 | 98 ftp_log (gftp_logging_error, NULL, |
1 | 99 _("Retrieve Files: Not connected to a remote site\n")); |
100 return; | |
101 } | |
102 | |
103 if (check_reconnect (fromwdata) < 0 || check_reconnect (towdata) < 0) | |
104 return; | |
105 | |
106 transfer = g_malloc0 (sizeof (*transfer)); | |
368 | 107 transfer->fromreq = gftp_copy_request (fromwdata->request); |
108 transfer->toreq = gftp_copy_request (towdata->request); | |
1 | 109 transfer->fromwdata = fromwdata; |
110 transfer->towdata = towdata; | |
111 | |
112 num = 0; | |
525 | 113 templist = gftp_gtk_get_list_selection (fromwdata); |
1 | 114 filelist = fromwdata->files; |
115 while (templist != NULL) | |
116 { | |
117 templist = get_next_selection (templist, &filelist, &num); | |
118 tempfle = filelist->data; | |
119 if (strcmp (tempfle->file, "..") != 0) | |
120 { | |
121 newfle = copy_fdata (tempfle); | |
122 transfer->files = g_list_append (transfer->files, newfle); | |
123 } | |
124 } | |
125 | |
126 if (transfer->files != NULL) | |
127 { | |
63 | 128 gftp_swap_socks (transfer->fromreq, fromwdata->request); |
129 gftp_swap_socks (transfer->toreq, towdata->request); | |
1 | 130 |
767 | 131 ret = gftp_gtk_get_subdirs (transfer); |
506 | 132 if (ret < 0) |
133 disconnect = 1; | |
1 | 134 else |
506 | 135 disconnect = 0; |
1 | 136 |
137 if (!GFTP_IS_CONNECTED (transfer->fromreq)) | |
138 { | |
380 | 139 gftpui_disconnect (fromwdata); |
506 | 140 disconnect = 1; |
1 | 141 } |
142 | |
143 if (!GFTP_IS_CONNECTED (transfer->toreq)) | |
144 { | |
380 | 145 gftpui_disconnect (towdata); |
506 | 146 disconnect = 1; |
147 } | |
148 | |
149 if (disconnect) | |
150 { | |
151 free_tdata (transfer); | |
1 | 152 return; |
506 | 153 } |
1 | 154 |
63 | 155 gftp_swap_socks (fromwdata->request, transfer->fromreq); |
156 gftp_swap_socks (towdata->request, transfer->toreq); | |
1 | 157 } |
158 | |
159 if (transfer->files != NULL) | |
160 { | |
367 | 161 gftpui_common_add_file_transfer (transfer->fromreq, transfer->toreq, |
162 transfer->fromwdata, transfer->towdata, | |
163 transfer->files); | |
1 | 164 g_free (transfer); |
165 } | |
166 else | |
129 | 167 free_tdata (transfer); |
1 | 168 } |
169 | |
506 | 170 |
508 | 171 static int |
511 | 172 gftpui_gtk_tdata_connect (gftpui_callback_data * cdata) |
173 { | |
174 gftp_transfer * tdata; | |
175 int ret; | |
176 | |
177 tdata = cdata->user_data; | |
178 | |
179 if (tdata->fromreq != NULL) | |
180 { | |
181 ret = gftp_connect (tdata->fromreq); | |
182 if (ret < 0) | |
183 return (ret); | |
184 } | |
185 | |
186 if (tdata->toreq != NULL) | |
187 { | |
188 ret = gftp_connect (tdata->toreq); | |
189 if (ret < 0) | |
190 return (ret); | |
191 } | |
192 | |
193 return (0); | |
194 } | |
195 | |
196 | |
197 static void | |
198 gftpui_gtk_tdata_disconnect (gftpui_callback_data * cdata) | |
199 { | |
200 gftp_transfer * tdata; | |
201 | |
202 tdata = cdata->user_data; | |
203 | |
204 if (tdata->fromreq != NULL) | |
205 gftp_disconnect (tdata->fromreq); | |
206 | |
207 if (tdata->toreq != NULL) | |
208 gftp_disconnect (tdata->toreq); | |
209 | |
210 cdata->request->datafd = -1; | |
211 } | |
212 | |
213 | |
214 static int | |
508 | 215 _gftp_getdir_thread (gftpui_callback_data * cdata) |
1 | 216 { |
508 | 217 return (gftp_get_all_subdirs (cdata->user_data, NULL)); |
1 | 218 } |
219 | |
220 | |
506 | 221 int |
767 | 222 gftp_gtk_get_subdirs (gftp_transfer * transfer) |
506 | 223 { |
508 | 224 gftpui_callback_data * cdata; |
506 | 225 long numfiles, numdirs; |
226 guint timeout_num; | |
508 | 227 int ret; |
506 | 228 |
508 | 229 cdata = g_malloc0 (sizeof (*cdata)); |
230 cdata->user_data = transfer; | |
231 cdata->uidata = transfer->fromwdata; | |
232 cdata->request = ((gftp_window_data *) transfer->fromwdata)->request; | |
233 cdata->run_function = _gftp_getdir_thread; | |
511 | 234 cdata->connect_function = gftpui_gtk_tdata_connect; |
235 cdata->disconnect_function = gftpui_gtk_tdata_disconnect; | |
236 cdata->dont_check_connection = 1; | |
237 cdata->dont_refresh = 1; | |
506 | 238 |
508 | 239 timeout_num = gtk_timeout_add (100, progress_timeout, transfer); |
240 ret = gftpui_common_run_callback_function (cdata); | |
241 gtk_timeout_remove (timeout_num); | |
506 | 242 |
508 | 243 numfiles = transfer->numfiles; |
244 numdirs = transfer->numdirs; | |
245 transfer->numfiles = transfer->numdirs = -1; | |
246 update_directory_download_progress (transfer); | |
247 transfer->numfiles = numfiles; | |
248 transfer->numdirs = numdirs; | |
506 | 249 |
508 | 250 g_free (cdata); |
506 | 251 |
508 | 252 return (ret); |
506 | 253 } |
254 | |
255 | |
305 | 256 static void |
48 | 257 remove_file (char *filename) |
258 { | |
259 if (unlink (filename) == 0) | |
260 ftp_log (gftp_logging_misc, NULL, _("Successfully removed %s\n"), | |
261 filename); | |
262 else | |
263 ftp_log (gftp_logging_error, NULL, | |
264 _("Error: Could not remove file %s: %s\n"), filename, | |
265 g_strerror (errno)); | |
266 } | |
267 | |
268 | |
269 static void | |
270 free_edit_data (gftp_viewedit_data * ve_proc) | |
271 { | |
272 int i; | |
273 | |
294 | 274 if (ve_proc->torequest) |
275 gftp_request_destroy (ve_proc->torequest, 1); | |
48 | 276 if (ve_proc->filename) |
277 g_free (ve_proc->filename); | |
278 if (ve_proc->remote_filename) | |
279 g_free (ve_proc->remote_filename); | |
280 for (i = 0; ve_proc->argv[i] != NULL; i++) | |
281 g_free (ve_proc->argv[i]); | |
282 g_free (ve_proc->argv); | |
283 g_free (ve_proc); | |
284 } | |
285 | |
286 | |
287 static void | |
288 dont_upload (gftp_viewedit_data * ve_proc, gftp_dialog_data * ddata) | |
1 | 289 { |
48 | 290 remove_file (ve_proc->filename); |
291 free_edit_data (ve_proc); | |
292 } | |
293 | |
294 | |
295 static void | |
296 do_upload (gftp_viewedit_data * ve_proc, gftp_dialog_data * ddata) | |
297 { | |
303 | 298 gftp_transfer * tdata; |
48 | 299 gftp_file * tempfle; |
300 GList * newfile; | |
1 | 301 |
48 | 302 tempfle = g_malloc0 (sizeof (*tempfle)); |
555 | 303 tempfle->destfile = gftp_build_path (ve_proc->torequest, |
304 ve_proc->torequest->directory, | |
294 | 305 ve_proc->remote_filename, NULL); |
48 | 306 ve_proc->remote_filename = NULL; |
307 tempfle->file = ve_proc->filename; | |
308 ve_proc->filename = NULL; | |
309 tempfle->done_rm = 1; | |
310 newfile = g_list_append (NULL, tempfle); | |
367 | 311 tdata = gftpui_common_add_file_transfer (ve_proc->fromwdata->request, |
312 ve_proc->torequest, | |
313 ve_proc->fromwdata, | |
314 ve_proc->towdata, newfile); | |
48 | 315 free_edit_data (ve_proc); |
303 | 316 |
317 if (tdata != NULL) | |
318 tdata->conn_error_no_timeout = 1; | |
48 | 319 } |
320 | |
1 | 321 |
48 | 322 static void |
323 check_done_process (void) | |
324 { | |
325 gftp_viewedit_data * ve_proc; | |
326 GList * curdata, *deldata; | |
556 | 327 int ret, procret; |
48 | 328 struct stat st; |
329 char *str; | |
330 pid_t pid; | |
331 | |
470 | 332 gftpui_common_child_process_done = 0; |
48 | 333 while ((pid = waitpid (-1, &ret, WNOHANG)) > 0) |
1 | 334 { |
48 | 335 curdata = viewedit_processes; |
336 while (curdata != NULL) | |
337 { | |
338 ve_proc = curdata->data; | |
339 deldata = curdata; | |
340 curdata = curdata->next; | |
341 if (ve_proc->pid == pid) | |
342 { | |
343 viewedit_processes = g_list_remove_link (viewedit_processes, | |
344 deldata); | |
556 | 345 if (WIFEXITED (ret)) |
346 { | |
347 procret = WEXITSTATUS (ret); | |
348 if (procret != 0) | |
559 | 349 { |
350 ftp_log (gftp_logging_error, NULL, | |
351 _("Error: Child %d returned %d\n"), pid, procret); | |
703 | 352 if (ve_proc->view) |
353 remove_file (ve_proc->filename); | |
559 | 354 continue; |
355 } | |
556 | 356 else |
357 ftp_log (gftp_logging_misc, NULL, | |
358 _("Child %d returned successfully\n"), pid); | |
359 } | |
360 else | |
361 ftp_log (gftp_logging_error, NULL, | |
362 _("Error: Child %d did not terminate properly\n"), | |
363 pid); | |
48 | 364 |
365 if (!ve_proc->view && !ve_proc->dontupload) | |
366 { | |
367 /* We was editing the file. Upload it */ | |
556 | 368 ret = stat (ve_proc->filename, &st); |
369 | |
370 if (ret == -1) | |
48 | 371 ftp_log (gftp_logging_error, NULL, |
372 _("Error: Cannot get information about file %s: %s\n"), | |
373 ve_proc->filename, g_strerror (errno)); | |
374 else if (st.st_mtime == ve_proc->st.st_mtime) | |
375 { | |
376 ftp_log (gftp_logging_misc, NULL, | |
377 _("File %s was not changed\n"), | |
378 ve_proc->filename); | |
379 remove_file (ve_proc->filename); | |
380 } | |
381 else | |
382 { | |
383 memcpy (&ve_proc->st, &st, sizeof (ve_proc->st)); | |
384 str = g_strdup_printf ( | |
385 _("File %s has changed.\nWould you like to upload it?"), | |
386 ve_proc->remote_filename); | |
387 | |
388 MakeYesNoDialog (_("Edit File"), str, | |
389 do_upload, ve_proc, | |
390 dont_upload, ve_proc); | |
391 g_free (str); | |
392 continue; | |
393 } | |
394 } | |
395 | |
396 free_edit_data (ve_proc); | |
397 continue; | |
398 } | |
1 | 399 } |
400 } | |
401 } | |
402 | |
403 | |
404 static void | |
405 on_next_transfer (gftp_transfer * tdata) | |
406 { | |
326 | 407 int fd; |
408 intptr_t refresh_files; | |
1 | 409 gftp_file * tempfle; |
410 | |
411 tdata->next_file = 0; | |
412 for (; tdata->updfle != tdata->curfle; tdata->updfle = tdata->updfle->next) | |
413 { | |
414 tempfle = tdata->updfle->data; | |
415 | |
416 if (tempfle->is_fd) | |
58 | 417 fd = tempfle->fd; |
1 | 418 else |
419 fd = 0; | |
420 | |
421 if (tempfle->done_view) | |
422 { | |
423 if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP) | |
424 view_file (tempfle->destfile, fd, 1, tempfle->done_rm, 1, 0, | |
425 tempfle->file, NULL); | |
426 | |
427 if (tempfle->is_fd) | |
428 { | |
58 | 429 close (tempfle->fd); |
430 tempfle->fd = -1; | |
1 | 431 } |
432 } | |
433 else if (tempfle->done_edit) | |
434 { | |
435 if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP) | |
436 view_file (tempfle->destfile, fd, 0, tempfle->done_rm, 1, 0, | |
437 tempfle->file, NULL); | |
438 | |
439 if (tempfle->is_fd) | |
440 { | |
58 | 441 close (tempfle->fd); |
442 tempfle->fd = -1; | |
1 | 443 } |
444 } | |
445 else if (tempfle->done_rm) | |
446 tdata->fromreq->rmfile (tdata->fromreq, tempfle->file); | |
447 | |
448 if (tempfle->transfer_action == GFTP_TRANS_ACTION_SKIP) | |
129 | 449 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, |
1 | 450 _("Skipped")); |
451 else | |
129 | 452 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, |
1 | 453 _("Finished")); |
454 } | |
455 | |
129 | 456 gftp_lookup_request_option (tdata->fromreq, "refresh_files", &refresh_files); |
457 | |
1 | 458 if (refresh_files && tdata->curfle && tdata->curfle->next && |
459 compare_request (tdata->toreq, | |
460 ((gftp_window_data *) tdata->towdata)->request, 1)) | |
514 | 461 gftpui_refresh (tdata->towdata, 1); |
1 | 462 } |
463 | |
464 | |
465 static void | |
19 | 466 get_trans_password (gftp_request * request, gftp_dialog_data * ddata) |
467 { | |
468 gftp_set_password (request, gtk_entry_get_text (GTK_ENTRY (ddata->edit))); | |
469 request->stopable = 0; | |
470 } | |
471 | |
472 | |
473 static void | |
474 cancel_get_trans_password (gftp_transfer * tdata, gftp_dialog_data * ddata) | |
475 { | |
476 if (tdata->fromreq->stopable == 0) | |
477 return; | |
478 | |
129 | 479 g_static_mutex_lock (&tdata->structmutex); |
19 | 480 if (tdata->started) |
42 | 481 { |
482 tdata->cancel = 1; | |
483 tdata->fromreq->cancel = 1; | |
484 tdata->toreq->cancel = 1; | |
485 } | |
19 | 486 else |
487 tdata->done = 1; | |
488 | |
489 tdata->fromreq->stopable = 0; | |
490 tdata->toreq->stopable = 0; | |
129 | 491 g_static_mutex_unlock (&tdata->structmutex); |
40 | 492 |
19 | 493 ftp_log (gftp_logging_misc, NULL, _("Stopping the transfer of %s\n"), |
494 ((gftp_file *) tdata->curfle->data)->file); | |
495 } | |
496 | |
497 | |
498 static void | |
1 | 499 show_transfer (gftp_transfer * tdata) |
500 { | |
501 GdkPixmap * closedir_pixmap, * opendir_pixmap; | |
502 GdkBitmap * closedir_bitmap, * opendir_bitmap; | |
367 | 503 gftpui_common_curtrans_data * transdata; |
1 | 504 gftp_file * tempfle; |
505 GList * templist; | |
397 | 506 char *text[2]; |
1 | 507 |
508 gftp_get_pixmap (dlwdw, "open_dir.xpm", &opendir_pixmap, &opendir_bitmap); | |
509 gftp_get_pixmap (dlwdw, "dir.xpm", &closedir_pixmap, &closedir_bitmap); | |
510 | |
129 | 511 text[0] = tdata->fromreq->hostname; |
1 | 512 text[1] = _("Waiting..."); |
129 | 513 tdata->user_data = gtk_ctree_insert_node (GTK_CTREE (dlwdw), NULL, NULL, |
514 text, 5, | |
1 | 515 closedir_pixmap, closedir_bitmap, |
516 opendir_pixmap, opendir_bitmap, | |
517 FALSE, | |
518 tdata->numdirs + tdata->numfiles < 50); | |
519 transdata = g_malloc (sizeof (*transdata)); | |
520 transdata->transfer = tdata; | |
521 transdata->curfle = NULL; | |
129 | 522 gtk_ctree_node_set_row_data (GTK_CTREE (dlwdw), tdata->user_data, transdata); |
1 | 523 tdata->show = 0; |
524 tdata->curfle = tdata->updfle = tdata->files; | |
525 | |
526 tdata->total_bytes = 0; | |
527 for (templist = tdata->files; templist != NULL; templist = templist->next) | |
528 { | |
529 tempfle = templist->data; | |
397 | 530 |
531 text[0] = gftpui_gtk_get_utf8_file_pos (tempfle); | |
1 | 532 if (tempfle->transfer_action == GFTP_TRANS_ACTION_SKIP) |
533 text[1] = _("Skipped"); | |
534 else | |
535 { | |
536 tdata->total_bytes += tempfle->size; | |
537 text[1] = _("Waiting..."); | |
538 } | |
539 | |
129 | 540 tempfle->user_data = gtk_ctree_insert_node (GTK_CTREE (dlwdw), |
541 tdata->user_data, | |
1 | 542 NULL, text, 5, NULL, NULL, NULL, |
543 NULL, FALSE, FALSE); | |
544 transdata = g_malloc (sizeof (*transdata)); | |
545 transdata->transfer = tdata; | |
546 transdata->curfle = templist; | |
129 | 547 gtk_ctree_node_set_row_data (GTK_CTREE (dlwdw), tempfle->user_data, |
548 transdata); | |
1 | 549 } |
550 | |
553 | 551 if (!tdata->toreq->stopable && gftp_need_password (tdata->toreq)) |
1 | 552 { |
553 tdata->toreq->stopable = 1; | |
554 MakeEditDialog (_("Enter Password"), | |
555 _("Please enter your password for this site"), NULL, 0, | |
19 | 556 NULL, gftp_dialog_button_connect, |
557 get_trans_password, tdata->toreq, | |
558 cancel_get_trans_password, tdata); | |
1 | 559 } |
560 | |
553 | 561 if (!tdata->fromreq->stopable && gftp_need_password (tdata->fromreq)) |
1 | 562 { |
563 tdata->fromreq->stopable = 1; | |
564 MakeEditDialog (_("Enter Password"), | |
565 _("Please enter your password for this site"), NULL, 0, | |
19 | 566 NULL, gftp_dialog_button_connect, |
567 get_trans_password, tdata->fromreq, | |
568 cancel_get_trans_password, tdata); | |
1 | 569 } |
570 } | |
571 | |
572 | |
573 static void | |
574 transfer_done (GList * node) | |
575 { | |
367 | 576 gftpui_common_curtrans_data * transdata; |
1 | 577 gftp_transfer * tdata; |
578 gftp_file * tempfle; | |
579 GList * templist; | |
580 | |
581 tdata = node->data; | |
582 if (tdata->started) | |
583 { | |
297 | 584 if (GFTP_IS_SAME_HOST_STOP_TRANS ((gftp_window_data *) tdata->fromwdata, |
585 tdata->fromreq)) | |
309 | 586 { |
587 gftp_copy_param_options (((gftp_window_data *) tdata->fromwdata)->request, tdata->fromreq); | |
588 | |
589 gftp_swap_socks (((gftp_window_data *) tdata->fromwdata)->request, | |
590 tdata->fromreq); | |
591 } | |
1 | 592 else |
297 | 593 gftp_disconnect (tdata->fromreq); |
594 | |
595 if (GFTP_IS_SAME_HOST_STOP_TRANS ((gftp_window_data *) tdata->towdata, | |
596 tdata->toreq)) | |
309 | 597 { |
598 gftp_copy_param_options (((gftp_window_data *) tdata->towdata)->request, tdata->toreq); | |
599 | |
600 gftp_swap_socks (((gftp_window_data *) tdata->towdata)->request, | |
601 tdata->toreq); | |
602 } | |
297 | 603 else |
604 gftp_disconnect (tdata->toreq); | |
1 | 605 |
305 | 606 if (tdata->towdata != NULL && compare_request (tdata->toreq, |
607 ((gftp_window_data *) tdata->towdata)->request, 1)) | |
514 | 608 gftpui_refresh (tdata->towdata, 1); |
305 | 609 |
129 | 610 num_transfers_in_progress--; |
1 | 611 } |
612 | |
2
a171df6764a7
* Fixed crash if you was already transfering a file, and you started another
masneyb
parents:
1
diff
changeset
|
613 if (!tdata->show && tdata->started) |
1 | 614 { |
129 | 615 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
616 tdata->user_data); | |
1 | 617 if (transdata != NULL) |
618 g_free (transdata); | |
619 | |
620 for (templist = tdata->files; templist != NULL; templist = templist->next) | |
621 { | |
622 tempfle = templist->data; | |
129 | 623 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
624 tempfle->user_data); | |
1 | 625 if (transdata != NULL) |
626 g_free (transdata); | |
627 } | |
628 | |
129 | 629 gtk_ctree_remove_node (GTK_CTREE (dlwdw), tdata->user_data); |
1 | 630 } |
129 | 631 |
367 | 632 g_static_mutex_lock (&gftpui_common_transfer_mutex); |
129 | 633 gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node); |
367 | 634 g_static_mutex_unlock (&gftpui_common_transfer_mutex); |
635 | |
320 | 636 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), |
637 gftp_version); | |
129 | 638 |
1 | 639 free_tdata (tdata); |
640 } | |
641 | |
642 | |
367 | 643 static void * |
644 _gftpui_transfer_files (void *data) | |
645 { | |
646 int ret; | |
647 | |
648 pthread_detach (pthread_self ()); | |
649 ret = gftpui_common_transfer_files (data); | |
650 return (GINT_TO_POINTER(ret)); | |
651 } | |
652 | |
653 | |
1 | 654 static void |
655 create_transfer (gftp_transfer * tdata) | |
656 { | |
657 pthread_t tid; | |
658 | |
659 if (!tdata->fromreq->stopable) | |
660 { | |
297 | 661 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->fromwdata, |
662 tdata->fromreq)) | |
663 { | |
664 gftp_swap_socks (tdata->fromreq, | |
665 ((gftp_window_data *) tdata->fromwdata)->request); | |
666 update_window (tdata->fromwdata); | |
667 } | |
668 | |
669 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->towdata, | |
670 tdata->toreq)) | |
671 { | |
63 | 672 gftp_swap_socks (tdata->toreq, |
673 ((gftp_window_data *) tdata->towdata)->request); | |
297 | 674 update_window (tdata->towdata); |
1 | 675 } |
297 | 676 |
129 | 677 num_transfers_in_progress++; |
1 | 678 tdata->started = 1; |
679 tdata->stalled = 1; | |
129 | 680 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, |
1 | 681 _("Connecting...")); |
367 | 682 pthread_create (&tid, NULL, _gftpui_transfer_files, tdata); |
1 | 683 } |
684 } | |
685 | |
686 | |
687 static void | |
753 | 688 _setup_dlstr (gftp_transfer * tdata, gftp_file * fle, char *dlstr, |
689 size_t dlstr_len) | |
690 { | |
767 | 691 int hours, mins, secs, stalled, usesentdescr; |
753 | 692 unsigned long remaining_secs, lkbs; |
693 char gotstr[50], ofstr[50]; | |
694 struct timeval tv; | |
695 | |
767 | 696 stalled = 1; |
753 | 697 gettimeofday (&tv, NULL); |
698 usesentdescr = (tdata->fromreq->protonum == GFTP_LOCAL_NUM); | |
699 | |
700 insert_commas (fle->size, ofstr, sizeof (ofstr)); | |
701 insert_commas (tdata->curtrans + tdata->curresumed, gotstr, sizeof (gotstr)); | |
702 | |
703 if (tv.tv_sec - tdata->lasttime.tv_sec <= 5) | |
704 { | |
767 | 705 remaining_secs = (fle->size - tdata->curtrans - tdata->curresumed) / 1024; |
706 | |
707 lkbs = (unsigned long) tdata->kbs; | |
708 if (lkbs > 0) | |
709 remaining_secs /= lkbs; | |
753 | 710 |
767 | 711 hours = remaining_secs / 3600; |
712 remaining_secs -= hours * 3600; | |
713 mins = remaining_secs / 60; | |
714 remaining_secs -= mins * 60; | |
715 secs = remaining_secs; | |
753 | 716 |
717 if (!(hours < 0 || mins < 0 || secs < 0)) | |
718 { | |
767 | 719 stalled = 0; |
753 | 720 if (usesentdescr) |
721 { | |
722 g_snprintf (dlstr, dlstr_len, | |
723 _("Sent %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
724 } | |
725 else | |
726 { | |
727 g_snprintf (dlstr, dlstr_len, | |
728 _("Recv %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
729 } | |
730 } | |
731 } | |
732 | |
767 | 733 if (stalled) |
753 | 734 { |
735 tdata->stalled = 1; | |
736 if (usesentdescr) | |
737 { | |
738 g_snprintf (dlstr, dlstr_len, | |
739 _("Sent %s of %s, transfer stalled, unknown time remaining"), | |
740 gotstr, ofstr); | |
741 } | |
742 else | |
743 { | |
744 g_snprintf (dlstr, dlstr_len, | |
745 _("Recv %s of %s, transfer stalled, unknown time remaining"), | |
746 gotstr, ofstr); | |
747 } | |
748 } | |
749 } | |
750 | |
751 | |
752 static void | |
1 | 753 update_file_status (gftp_transfer * tdata) |
754 { | |
753 | 755 char totstr[150], winstr[150], dlstr[150]; |
246 | 756 unsigned long remaining_secs, lkbs; |
767 | 757 int hours, mins, secs, pcent; |
463 | 758 intptr_t show_trans_in_title; |
1 | 759 gftp_file * tempfle; |
320 | 760 |
129 | 761 g_static_mutex_lock (&tdata->statmutex); |
1 | 762 tempfle = tdata->curfle->data; |
763 | |
220 | 764 remaining_secs = (tdata->total_bytes - tdata->trans_bytes - tdata->resumed_bytes) / 1024; |
246 | 765 |
766 lkbs = (unsigned long) tdata->kbs; | |
767 if (lkbs > 0) | |
768 remaining_secs /= lkbs; | |
1 | 769 |
220 | 770 hours = remaining_secs / 3600; |
771 remaining_secs -= hours * 3600; | |
772 mins = remaining_secs / 60; | |
773 remaining_secs -= mins * 60; | |
774 secs = remaining_secs; | |
1 | 775 |
776 if (hours < 0 || mins < 0 || secs < 0) | |
777 { | |
129 | 778 g_static_mutex_unlock (&tdata->statmutex); |
1 | 779 return; |
780 } | |
781 | |
246 | 782 if ((double) tdata->total_bytes > 0) |
783 pcent = (int) ((double) (tdata->trans_bytes + tdata->resumed_bytes) / (double) tdata->total_bytes * 100.0); | |
784 else | |
1 | 785 pcent = 0; |
786 | |
602 | 787 if (pcent > 100) |
788 g_snprintf (totstr, sizeof (totstr), | |
789 _("Unknown percentage complete. (File %ld of %ld)"), | |
790 tdata->current_file_number, tdata->numdirs + tdata->numfiles); | |
791 else | |
792 g_snprintf (totstr, sizeof (totstr), | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
793 _("%d%% complete, %02d:%02d:%02d est. time remaining. (File %ld of %ld)"), |
1 | 794 pcent, hours, mins, secs, tdata->current_file_number, |
795 tdata->numdirs + tdata->numfiles); | |
796 | |
797 *dlstr = '\0'; | |
798 if (!tdata->stalled) | |
753 | 799 _setup_dlstr (tdata, tempfle, dlstr, sizeof (dlstr)); |
1 | 800 |
129 | 801 g_static_mutex_unlock (&tdata->statmutex); |
1 | 802 |
129 | 803 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr); |
320 | 804 |
805 gftp_lookup_global_option ("show_trans_in_title", &show_trans_in_title); | |
806 if (gftp_file_transfers->data == tdata && show_trans_in_title) | |
807 { | |
808 g_snprintf (winstr, sizeof(winstr), "%s: %s", gftp_version, totstr); | |
809 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), | |
810 winstr); | |
811 } | |
1 | 812 |
813 if (*dlstr != '\0') | |
129 | 814 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr); |
1 | 815 } |
816 | |
377 | 817 |
56 | 818 static void |
819 update_window_transfer_bytes (gftp_window_data * wdata) | |
820 { | |
821 char *tempstr, *temp1str; | |
822 | |
823 if (wdata->request->gotbytes == -1) | |
824 { | |
825 update_window_info (); | |
826 wdata->request->gotbytes = 0; | |
827 } | |
828 else | |
829 { | |
830 tempstr = insert_commas (wdata->request->gotbytes, NULL, 0); | |
831 temp1str = g_strdup_printf (_("Retrieving file names...%s bytes"), | |
832 tempstr); | |
833 gtk_label_set (GTK_LABEL (wdata->hoststxt), temp1str); | |
834 g_free (tempstr); | |
835 g_free (temp1str); | |
836 } | |
837 } | |
838 | |
1 | 839 |
48 | 840 gint |
841 update_downloads (gpointer data) | |
842 { | |
433 | 843 intptr_t do_one_transfer_at_a_time, start_transfers; |
48 | 844 GList * templist, * next; |
845 gftp_transfer * tdata; | |
846 | |
129 | 847 if (gftp_file_transfer_logs != NULL) |
48 | 848 display_cached_logs (); |
849 | |
56 | 850 if (window1.request->gotbytes != 0) |
851 update_window_transfer_bytes (&window1); | |
48 | 852 if (window2.request->gotbytes != 0) |
56 | 853 update_window_transfer_bytes (&window2); |
48 | 854 |
470 | 855 if (gftpui_common_child_process_done) |
48 | 856 check_done_process (); |
857 | |
129 | 858 for (templist = gftp_file_transfers; templist != NULL;) |
48 | 859 { |
860 tdata = templist->data; | |
861 if (tdata->ready) | |
862 { | |
129 | 863 g_static_mutex_lock (&tdata->structmutex); |
48 | 864 |
865 if (tdata->next_file) | |
866 on_next_transfer (tdata); | |
867 else if (tdata->show) | |
868 show_transfer (tdata); | |
869 else if (tdata->done) | |
870 { | |
871 next = templist->next; | |
129 | 872 g_static_mutex_unlock (&tdata->structmutex); |
48 | 873 transfer_done (templist); |
874 templist = next; | |
875 continue; | |
876 } | |
877 | |
878 if (tdata->curfle != NULL) | |
879 { | |
151 | 880 gftp_lookup_global_option ("one_transfer", |
129 | 881 &do_one_transfer_at_a_time); |
433 | 882 gftp_lookup_global_option ("start_transfers", &start_transfers); |
129 | 883 |
433 | 884 if (!tdata->started && start_transfers && |
129 | 885 (num_transfers_in_progress == 0 || !do_one_transfer_at_a_time)) |
48 | 886 create_transfer (tdata); |
887 | |
888 if (tdata->started) | |
889 update_file_status (tdata); | |
890 } | |
129 | 891 g_static_mutex_unlock (&tdata->structmutex); |
48 | 892 } |
893 templist = templist->next; | |
894 } | |
895 | |
896 gtk_timeout_add (500, update_downloads, NULL); | |
897 return (0); | |
898 } | |
899 | |
900 | |
1 | 901 void |
902 start_transfer (gpointer data) | |
903 { | |
367 | 904 gftpui_common_curtrans_data * transdata; |
1 | 905 GtkCTreeNode * node; |
906 | |
907 if (GTK_CLIST (dlwdw)->selection == NULL) | |
908 { | |
677 | 909 ftp_log (gftp_logging_error, NULL, |
1 | 910 _("There are no file transfers selected\n")); |
911 return; | |
912 } | |
913 node = GTK_CLIST (dlwdw)->selection->data; | |
914 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
915 | |
129 | 916 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 917 if (!transdata->transfer->started) |
918 create_transfer (transdata->transfer); | |
129 | 919 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 920 } |
921 | |
922 | |
923 void | |
924 stop_transfer (gpointer data) | |
925 { | |
367 | 926 gftpui_common_curtrans_data * transdata; |
1 | 927 GtkCTreeNode * node; |
928 | |
929 if (GTK_CLIST (dlwdw)->selection == NULL) | |
930 { | |
677 | 931 ftp_log (gftp_logging_error, NULL, |
1 | 932 _("There are no file transfers selected\n")); |
933 return; | |
934 } | |
935 node = GTK_CLIST (dlwdw)->selection->data; | |
936 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
937 | |
129 | 938 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 939 if (transdata->transfer->started) |
940 { | |
941 transdata->transfer->cancel = 1; | |
42 | 942 transdata->transfer->fromreq->cancel = 1; |
943 transdata->transfer->toreq->cancel = 1; | |
1 | 944 transdata->transfer->skip_file = 0; |
945 } | |
946 else | |
947 transdata->transfer->done = 1; | |
129 | 948 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 949 |
1 | 950 ftp_log (gftp_logging_misc, NULL, _("Stopping the transfer on host %s\n"), |
951 transdata->transfer->fromreq->hostname); | |
952 } | |
953 | |
954 | |
955 void | |
956 skip_transfer (gpointer data) | |
957 { | |
367 | 958 gftpui_common_curtrans_data * transdata; |
1 | 959 GtkCTreeNode * node; |
960 gftp_file * curfle; | |
40 | 961 char *file; |
1 | 962 |
963 if (GTK_CLIST (dlwdw)->selection == NULL) | |
964 { | |
677 | 965 ftp_log (gftp_logging_error, NULL, |
1 | 966 _("There are no file transfers selected\n")); |
967 return; | |
968 } | |
969 node = GTK_CLIST (dlwdw)->selection->data; | |
970 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
971 | |
129 | 972 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 973 if (transdata->transfer->curfle != NULL) |
974 { | |
975 curfle = transdata->transfer->curfle->data; | |
976 if (transdata->transfer->started) | |
977 { | |
978 transdata->transfer->cancel = 1; | |
42 | 979 transdata->transfer->fromreq->cancel = 1; |
980 transdata->transfer->toreq->cancel = 1; | |
1 | 981 transdata->transfer->skip_file = 1; |
982 } | |
983 | |
984 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
40 | 985 file = curfle->file; |
1 | 986 } |
40 | 987 else |
988 file = NULL; | |
129 | 989 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 990 |
991 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), | |
992 file, transdata->transfer->fromreq->hostname); | |
1 | 993 } |
994 | |
995 | |
996 void | |
997 remove_file_transfer (gpointer data) | |
998 { | |
367 | 999 gftpui_common_curtrans_data * transdata; |
1 | 1000 GtkCTreeNode * node; |
1001 gftp_file * curfle; | |
1002 | |
1003 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1004 { | |
677 | 1005 ftp_log (gftp_logging_error, NULL, |
1 | 1006 _("There are no file transfers selected\n")); |
1007 return; | |
1008 } | |
1009 | |
1010 node = GTK_CLIST (dlwdw)->selection->data; | |
1011 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1012 | |
1013 | |
1014 if (transdata->curfle == NULL || transdata->curfle->data == NULL) | |
1015 return; | |
1016 | |
1017 curfle = transdata->curfle->data; | |
1018 | |
1019 if (curfle->transfer_action & GFTP_TRANS_ACTION_SKIP) | |
1020 return; | |
1021 | |
129 | 1022 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1023 |
1024 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
1025 | |
1026 if (transdata->transfer->started && | |
1027 transdata->curfle == transdata->transfer->curfle) | |
1028 { | |
1029 transdata->transfer->cancel = 1; | |
42 | 1030 transdata->transfer->fromreq->cancel = 1; |
1031 transdata->transfer->toreq->cancel = 1; | |
1 | 1032 transdata->transfer->skip_file = 1; |
1033 } | |
1034 else if (transdata->curfle != transdata->transfer->curfle && | |
1035 !curfle->transfer_done) | |
1036 { | |
129 | 1037 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), curfle->user_data, 1, |
1 | 1038 _("Skipped")); |
1039 transdata->transfer->total_bytes -= curfle->size; | |
1040 } | |
1041 | |
129 | 1042 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 1043 |
1 | 1044 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), |
1045 curfle->file, transdata->transfer->fromreq->hostname); | |
1046 } | |
1047 | |
1048 | |
1049 void | |
1050 move_transfer_up (gpointer data) | |
1051 { | |
1052 GList * firstentry, * secentry, * lastentry; | |
367 | 1053 gftpui_common_curtrans_data * transdata; |
1 | 1054 GtkCTreeNode * node; |
1055 | |
1056 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1057 { | |
677 | 1058 ftp_log (gftp_logging_error, NULL, |
1 | 1059 _("There are no file transfers selected\n")); |
1060 return; | |
1061 } | |
1062 node = GTK_CLIST (dlwdw)->selection->data; | |
1063 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1064 | |
1065 if (transdata->curfle == NULL) | |
1066 return; | |
1067 | |
129 | 1068 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1069 if (transdata->curfle->prev != NULL && (!transdata->transfer->started || |
1070 (transdata->transfer->curfle != transdata->curfle && | |
1071 transdata->transfer->curfle != transdata->curfle->prev))) | |
1072 { | |
1073 if (transdata->curfle->prev->prev == NULL) | |
1074 { | |
1075 firstentry = transdata->curfle->prev; | |
1076 lastentry = transdata->curfle->next; | |
1077 transdata->transfer->files = transdata->curfle; | |
1078 transdata->curfle->next = firstentry; | |
1079 transdata->transfer->files->prev = NULL; | |
1080 firstentry->prev = transdata->curfle; | |
1081 firstentry->next = lastentry; | |
1082 if (lastentry != NULL) | |
1083 lastentry->prev = firstentry; | |
1084 } | |
1085 else | |
1086 { | |
1087 firstentry = transdata->curfle->prev->prev; | |
1088 secentry = transdata->curfle->prev; | |
1089 lastentry = transdata->curfle->next; | |
1090 firstentry->next = transdata->curfle; | |
1091 transdata->curfle->prev = firstentry; | |
1092 transdata->curfle->next = secentry; | |
1093 secentry->prev = transdata->curfle; | |
1094 secentry->next = lastentry; | |
1095 if (lastentry != NULL) | |
1096 lastentry->prev = secentry; | |
1097 } | |
1098 | |
1099 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1100 ((gftp_file *) transdata->curfle->data)->user_data, |
1101 transdata->transfer->user_data, | |
1 | 1102 transdata->curfle->next != NULL ? |
129 | 1103 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1104 } |
129 | 1105 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1106 } |
1107 | |
367 | 1108 |
1 | 1109 void |
1110 move_transfer_down (gpointer data) | |
1111 { | |
1112 GList * firstentry, * secentry, * lastentry; | |
367 | 1113 gftpui_common_curtrans_data * transdata; |
1 | 1114 GtkCTreeNode * node; |
1115 | |
1116 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1117 { | |
677 | 1118 ftp_log (gftp_logging_error, NULL, |
1 | 1119 _("There are no file transfers selected\n")); |
1120 return; | |
1121 } | |
1122 node = GTK_CLIST (dlwdw)->selection->data; | |
1123 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1124 | |
1125 if (transdata->curfle == NULL) | |
1126 return; | |
1127 | |
129 | 1128 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1129 if (transdata->curfle->next != NULL && (!transdata->transfer->started || |
1130 (transdata->transfer->curfle != transdata->curfle && | |
1131 transdata->transfer->curfle != transdata->curfle->next))) | |
1132 { | |
1133 if (transdata->curfle->prev == NULL) | |
1134 { | |
1135 firstentry = transdata->curfle->next; | |
1136 lastentry = transdata->curfle->next->next; | |
1137 transdata->transfer->files = firstentry; | |
1138 transdata->transfer->files->prev = NULL; | |
1139 transdata->transfer->files->next = transdata->curfle; | |
1140 transdata->curfle->prev = transdata->transfer->files; | |
1141 transdata->curfle->next = lastentry; | |
1142 if (lastentry != NULL) | |
1143 lastentry->prev = transdata->curfle; | |
1144 } | |
1145 else | |
1146 { | |
1147 firstentry = transdata->curfle->prev; | |
1148 secentry = transdata->curfle->next; | |
1149 lastentry = transdata->curfle->next->next; | |
1150 firstentry->next = secentry; | |
1151 secentry->prev = firstentry; | |
1152 secentry->next = transdata->curfle; | |
1153 transdata->curfle->prev = secentry; | |
1154 transdata->curfle->next = lastentry; | |
1155 if (lastentry != NULL) | |
1156 lastentry->prev = transdata->curfle; | |
1157 } | |
1158 | |
1159 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1160 ((gftp_file *) transdata->curfle->data)->user_data, |
1161 transdata->transfer->user_data, | |
1 | 1162 transdata->curfle->next != NULL ? |
129 | 1163 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1164 } |
129 | 1165 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1166 } |
1167 |