Mercurial > gftp.yaz
annotate src/gtk/transfer.c @ 778:cf2a51deefd8
2006-7-19 Brian Masney <masneyb@gftp.org>
* src/gtk/transfer.c (check_done_process) - make sure the temporary
files are removed in all cases (from Madhan Raj
<raj_madan@rediffmail.com>) (closes #171459)
author | masneyb |
---|---|
date | Thu, 20 Jul 2006 02:41:26 +0000 |
parents | eeb471438232 |
children | 19aaa1571cc8 |
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 |
770 | 257 remove_file (gftp_viewedit_data * ve_proc) |
48 | 258 { |
770 | 259 if (ve_proc->remote_filename == NULL) |
260 return; | |
261 | |
262 if (unlink (ve_proc->filename) == 0) | |
48 | 263 ftp_log (gftp_logging_misc, NULL, _("Successfully removed %s\n"), |
770 | 264 ve_proc->filename); |
48 | 265 else |
266 ftp_log (gftp_logging_error, NULL, | |
770 | 267 _("Error: Could not remove file %s: %s\n"), ve_proc->filename, |
48 | 268 g_strerror (errno)); |
269 } | |
270 | |
271 | |
272 static void | |
273 free_edit_data (gftp_viewedit_data * ve_proc) | |
274 { | |
275 int i; | |
276 | |
294 | 277 if (ve_proc->torequest) |
278 gftp_request_destroy (ve_proc->torequest, 1); | |
48 | 279 if (ve_proc->filename) |
280 g_free (ve_proc->filename); | |
281 if (ve_proc->remote_filename) | |
282 g_free (ve_proc->remote_filename); | |
283 for (i = 0; ve_proc->argv[i] != NULL; i++) | |
284 g_free (ve_proc->argv[i]); | |
285 g_free (ve_proc->argv); | |
286 g_free (ve_proc); | |
287 } | |
288 | |
289 | |
290 static void | |
291 dont_upload (gftp_viewedit_data * ve_proc, gftp_dialog_data * ddata) | |
1 | 292 { |
770 | 293 remove_file (ve_proc); |
48 | 294 free_edit_data (ve_proc); |
295 } | |
296 | |
297 | |
298 static void | |
299 do_upload (gftp_viewedit_data * ve_proc, gftp_dialog_data * ddata) | |
300 { | |
303 | 301 gftp_transfer * tdata; |
48 | 302 gftp_file * tempfle; |
303 GList * newfile; | |
1 | 304 |
48 | 305 tempfle = g_malloc0 (sizeof (*tempfle)); |
555 | 306 tempfle->destfile = gftp_build_path (ve_proc->torequest, |
307 ve_proc->torequest->directory, | |
294 | 308 ve_proc->remote_filename, NULL); |
48 | 309 ve_proc->remote_filename = NULL; |
310 tempfle->file = ve_proc->filename; | |
311 ve_proc->filename = NULL; | |
312 tempfle->done_rm = 1; | |
313 newfile = g_list_append (NULL, tempfle); | |
367 | 314 tdata = gftpui_common_add_file_transfer (ve_proc->fromwdata->request, |
315 ve_proc->torequest, | |
316 ve_proc->fromwdata, | |
317 ve_proc->towdata, newfile); | |
48 | 318 free_edit_data (ve_proc); |
303 | 319 |
320 if (tdata != NULL) | |
321 tdata->conn_error_no_timeout = 1; | |
48 | 322 } |
323 | |
1 | 324 |
48 | 325 static void |
326 check_done_process (void) | |
327 { | |
328 gftp_viewedit_data * ve_proc; | |
329 GList * curdata, *deldata; | |
556 | 330 int ret, procret; |
48 | 331 struct stat st; |
332 char *str; | |
333 pid_t pid; | |
334 | |
470 | 335 gftpui_common_child_process_done = 0; |
48 | 336 while ((pid = waitpid (-1, &ret, WNOHANG)) > 0) |
1 | 337 { |
48 | 338 curdata = viewedit_processes; |
339 while (curdata != NULL) | |
340 { | |
341 ve_proc = curdata->data; | |
342 deldata = curdata; | |
343 curdata = curdata->next; | |
344 if (ve_proc->pid == pid) | |
345 { | |
346 viewedit_processes = g_list_remove_link (viewedit_processes, | |
347 deldata); | |
556 | 348 if (WIFEXITED (ret)) |
349 { | |
350 procret = WEXITSTATUS (ret); | |
351 if (procret != 0) | |
559 | 352 { |
353 ftp_log (gftp_logging_error, NULL, | |
354 _("Error: Child %d returned %d\n"), pid, procret); | |
703 | 355 if (ve_proc->view) |
770 | 356 remove_file (ve_proc); |
559 | 357 continue; |
358 } | |
556 | 359 else |
360 ftp_log (gftp_logging_misc, NULL, | |
361 _("Child %d returned successfully\n"), pid); | |
362 } | |
363 else | |
364 ftp_log (gftp_logging_error, NULL, | |
365 _("Error: Child %d did not terminate properly\n"), | |
366 pid); | |
48 | 367 |
368 if (!ve_proc->view && !ve_proc->dontupload) | |
369 { | |
370 /* We was editing the file. Upload it */ | |
556 | 371 ret = stat (ve_proc->filename, &st); |
372 | |
373 if (ret == -1) | |
48 | 374 ftp_log (gftp_logging_error, NULL, |
375 _("Error: Cannot get information about file %s: %s\n"), | |
376 ve_proc->filename, g_strerror (errno)); | |
377 else if (st.st_mtime == ve_proc->st.st_mtime) | |
378 { | |
379 ftp_log (gftp_logging_misc, NULL, | |
380 _("File %s was not changed\n"), | |
381 ve_proc->filename); | |
770 | 382 remove_file (ve_proc); |
48 | 383 } |
384 else | |
385 { | |
386 memcpy (&ve_proc->st, &st, sizeof (ve_proc->st)); | |
387 str = g_strdup_printf ( | |
388 _("File %s has changed.\nWould you like to upload it?"), | |
389 ve_proc->remote_filename); | |
390 | |
391 MakeYesNoDialog (_("Edit File"), str, | |
392 do_upload, ve_proc, | |
393 dont_upload, ve_proc); | |
394 g_free (str); | |
395 continue; | |
396 } | |
397 } | |
778 | 398 else if (ve_proc->view && ve_proc->rm) |
399 { | |
400 /* After viewing the file delete the tmp file */ | |
401 remove_file (ve_proc); | |
402 } | |
48 | 403 |
404 free_edit_data (ve_proc); | |
405 continue; | |
406 } | |
1 | 407 } |
408 } | |
409 } | |
410 | |
411 | |
412 static void | |
413 on_next_transfer (gftp_transfer * tdata) | |
414 { | |
326 | 415 int fd; |
416 intptr_t refresh_files; | |
1 | 417 gftp_file * tempfle; |
418 | |
419 tdata->next_file = 0; | |
420 for (; tdata->updfle != tdata->curfle; tdata->updfle = tdata->updfle->next) | |
421 { | |
422 tempfle = tdata->updfle->data; | |
423 | |
424 if (tempfle->is_fd) | |
58 | 425 fd = tempfle->fd; |
1 | 426 else |
427 fd = 0; | |
428 | |
429 if (tempfle->done_view) | |
430 { | |
431 if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP) | |
432 view_file (tempfle->destfile, fd, 1, tempfle->done_rm, 1, 0, | |
433 tempfle->file, NULL); | |
434 | |
435 if (tempfle->is_fd) | |
436 { | |
58 | 437 close (tempfle->fd); |
438 tempfle->fd = -1; | |
1 | 439 } |
440 } | |
441 else if (tempfle->done_edit) | |
442 { | |
443 if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP) | |
444 view_file (tempfle->destfile, fd, 0, tempfle->done_rm, 1, 0, | |
445 tempfle->file, NULL); | |
446 | |
447 if (tempfle->is_fd) | |
448 { | |
58 | 449 close (tempfle->fd); |
450 tempfle->fd = -1; | |
1 | 451 } |
452 } | |
453 else if (tempfle->done_rm) | |
454 tdata->fromreq->rmfile (tdata->fromreq, tempfle->file); | |
455 | |
456 if (tempfle->transfer_action == GFTP_TRANS_ACTION_SKIP) | |
129 | 457 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, |
1 | 458 _("Skipped")); |
459 else | |
129 | 460 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, |
1 | 461 _("Finished")); |
462 } | |
463 | |
129 | 464 gftp_lookup_request_option (tdata->fromreq, "refresh_files", &refresh_files); |
465 | |
1 | 466 if (refresh_files && tdata->curfle && tdata->curfle->next && |
467 compare_request (tdata->toreq, | |
468 ((gftp_window_data *) tdata->towdata)->request, 1)) | |
514 | 469 gftpui_refresh (tdata->towdata, 1); |
1 | 470 } |
471 | |
472 | |
473 static void | |
19 | 474 get_trans_password (gftp_request * request, gftp_dialog_data * ddata) |
475 { | |
476 gftp_set_password (request, gtk_entry_get_text (GTK_ENTRY (ddata->edit))); | |
477 request->stopable = 0; | |
478 } | |
479 | |
480 | |
481 static void | |
482 cancel_get_trans_password (gftp_transfer * tdata, gftp_dialog_data * ddata) | |
483 { | |
484 if (tdata->fromreq->stopable == 0) | |
485 return; | |
486 | |
129 | 487 g_static_mutex_lock (&tdata->structmutex); |
19 | 488 if (tdata->started) |
42 | 489 { |
490 tdata->cancel = 1; | |
491 tdata->fromreq->cancel = 1; | |
492 tdata->toreq->cancel = 1; | |
493 } | |
19 | 494 else |
495 tdata->done = 1; | |
496 | |
497 tdata->fromreq->stopable = 0; | |
498 tdata->toreq->stopable = 0; | |
129 | 499 g_static_mutex_unlock (&tdata->structmutex); |
40 | 500 |
19 | 501 ftp_log (gftp_logging_misc, NULL, _("Stopping the transfer of %s\n"), |
502 ((gftp_file *) tdata->curfle->data)->file); | |
503 } | |
504 | |
505 | |
506 static void | |
1 | 507 show_transfer (gftp_transfer * tdata) |
508 { | |
509 GdkPixmap * closedir_pixmap, * opendir_pixmap; | |
510 GdkBitmap * closedir_bitmap, * opendir_bitmap; | |
367 | 511 gftpui_common_curtrans_data * transdata; |
1 | 512 gftp_file * tempfle; |
513 GList * templist; | |
397 | 514 char *text[2]; |
1 | 515 |
516 gftp_get_pixmap (dlwdw, "open_dir.xpm", &opendir_pixmap, &opendir_bitmap); | |
517 gftp_get_pixmap (dlwdw, "dir.xpm", &closedir_pixmap, &closedir_bitmap); | |
518 | |
129 | 519 text[0] = tdata->fromreq->hostname; |
1 | 520 text[1] = _("Waiting..."); |
129 | 521 tdata->user_data = gtk_ctree_insert_node (GTK_CTREE (dlwdw), NULL, NULL, |
522 text, 5, | |
1 | 523 closedir_pixmap, closedir_bitmap, |
524 opendir_pixmap, opendir_bitmap, | |
525 FALSE, | |
526 tdata->numdirs + tdata->numfiles < 50); | |
527 transdata = g_malloc (sizeof (*transdata)); | |
528 transdata->transfer = tdata; | |
529 transdata->curfle = NULL; | |
129 | 530 gtk_ctree_node_set_row_data (GTK_CTREE (dlwdw), tdata->user_data, transdata); |
1 | 531 tdata->show = 0; |
532 tdata->curfle = tdata->updfle = tdata->files; | |
533 | |
534 tdata->total_bytes = 0; | |
535 for (templist = tdata->files; templist != NULL; templist = templist->next) | |
536 { | |
537 tempfle = templist->data; | |
397 | 538 |
539 text[0] = gftpui_gtk_get_utf8_file_pos (tempfle); | |
1 | 540 if (tempfle->transfer_action == GFTP_TRANS_ACTION_SKIP) |
541 text[1] = _("Skipped"); | |
542 else | |
543 { | |
544 tdata->total_bytes += tempfle->size; | |
545 text[1] = _("Waiting..."); | |
546 } | |
547 | |
129 | 548 tempfle->user_data = gtk_ctree_insert_node (GTK_CTREE (dlwdw), |
549 tdata->user_data, | |
1 | 550 NULL, text, 5, NULL, NULL, NULL, |
551 NULL, FALSE, FALSE); | |
552 transdata = g_malloc (sizeof (*transdata)); | |
553 transdata->transfer = tdata; | |
554 transdata->curfle = templist; | |
129 | 555 gtk_ctree_node_set_row_data (GTK_CTREE (dlwdw), tempfle->user_data, |
556 transdata); | |
1 | 557 } |
558 | |
553 | 559 if (!tdata->toreq->stopable && gftp_need_password (tdata->toreq)) |
1 | 560 { |
561 tdata->toreq->stopable = 1; | |
562 MakeEditDialog (_("Enter Password"), | |
563 _("Please enter your password for this site"), NULL, 0, | |
19 | 564 NULL, gftp_dialog_button_connect, |
565 get_trans_password, tdata->toreq, | |
566 cancel_get_trans_password, tdata); | |
1 | 567 } |
568 | |
553 | 569 if (!tdata->fromreq->stopable && gftp_need_password (tdata->fromreq)) |
1 | 570 { |
571 tdata->fromreq->stopable = 1; | |
572 MakeEditDialog (_("Enter Password"), | |
573 _("Please enter your password for this site"), NULL, 0, | |
19 | 574 NULL, gftp_dialog_button_connect, |
575 get_trans_password, tdata->fromreq, | |
576 cancel_get_trans_password, tdata); | |
1 | 577 } |
578 } | |
579 | |
580 | |
581 static void | |
582 transfer_done (GList * node) | |
583 { | |
367 | 584 gftpui_common_curtrans_data * transdata; |
1 | 585 gftp_transfer * tdata; |
586 gftp_file * tempfle; | |
587 GList * templist; | |
588 | |
589 tdata = node->data; | |
590 if (tdata->started) | |
591 { | |
297 | 592 if (GFTP_IS_SAME_HOST_STOP_TRANS ((gftp_window_data *) tdata->fromwdata, |
593 tdata->fromreq)) | |
309 | 594 { |
595 gftp_copy_param_options (((gftp_window_data *) tdata->fromwdata)->request, tdata->fromreq); | |
596 | |
597 gftp_swap_socks (((gftp_window_data *) tdata->fromwdata)->request, | |
598 tdata->fromreq); | |
599 } | |
1 | 600 else |
297 | 601 gftp_disconnect (tdata->fromreq); |
602 | |
603 if (GFTP_IS_SAME_HOST_STOP_TRANS ((gftp_window_data *) tdata->towdata, | |
604 tdata->toreq)) | |
309 | 605 { |
606 gftp_copy_param_options (((gftp_window_data *) tdata->towdata)->request, tdata->toreq); | |
607 | |
608 gftp_swap_socks (((gftp_window_data *) tdata->towdata)->request, | |
609 tdata->toreq); | |
610 } | |
297 | 611 else |
612 gftp_disconnect (tdata->toreq); | |
1 | 613 |
305 | 614 if (tdata->towdata != NULL && compare_request (tdata->toreq, |
615 ((gftp_window_data *) tdata->towdata)->request, 1)) | |
514 | 616 gftpui_refresh (tdata->towdata, 1); |
305 | 617 |
129 | 618 num_transfers_in_progress--; |
1 | 619 } |
620 | |
2
a171df6764a7
* Fixed crash if you was already transfering a file, and you started another
masneyb
parents:
1
diff
changeset
|
621 if (!tdata->show && tdata->started) |
1 | 622 { |
129 | 623 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
624 tdata->user_data); | |
1 | 625 if (transdata != NULL) |
626 g_free (transdata); | |
627 | |
628 for (templist = tdata->files; templist != NULL; templist = templist->next) | |
629 { | |
630 tempfle = templist->data; | |
129 | 631 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
632 tempfle->user_data); | |
1 | 633 if (transdata != NULL) |
634 g_free (transdata); | |
635 } | |
636 | |
129 | 637 gtk_ctree_remove_node (GTK_CTREE (dlwdw), tdata->user_data); |
1 | 638 } |
129 | 639 |
367 | 640 g_static_mutex_lock (&gftpui_common_transfer_mutex); |
129 | 641 gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node); |
367 | 642 g_static_mutex_unlock (&gftpui_common_transfer_mutex); |
643 | |
320 | 644 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), |
645 gftp_version); | |
129 | 646 |
1 | 647 free_tdata (tdata); |
648 } | |
649 | |
650 | |
367 | 651 static void * |
652 _gftpui_transfer_files (void *data) | |
653 { | |
654 int ret; | |
655 | |
656 pthread_detach (pthread_self ()); | |
657 ret = gftpui_common_transfer_files (data); | |
658 return (GINT_TO_POINTER(ret)); | |
659 } | |
660 | |
661 | |
1 | 662 static void |
663 create_transfer (gftp_transfer * tdata) | |
664 { | |
665 pthread_t tid; | |
666 | |
667 if (!tdata->fromreq->stopable) | |
668 { | |
297 | 669 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->fromwdata, |
670 tdata->fromreq)) | |
671 { | |
672 gftp_swap_socks (tdata->fromreq, | |
673 ((gftp_window_data *) tdata->fromwdata)->request); | |
674 update_window (tdata->fromwdata); | |
675 } | |
676 | |
677 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->towdata, | |
678 tdata->toreq)) | |
679 { | |
63 | 680 gftp_swap_socks (tdata->toreq, |
681 ((gftp_window_data *) tdata->towdata)->request); | |
297 | 682 update_window (tdata->towdata); |
1 | 683 } |
297 | 684 |
129 | 685 num_transfers_in_progress++; |
1 | 686 tdata->started = 1; |
687 tdata->stalled = 1; | |
129 | 688 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, |
1 | 689 _("Connecting...")); |
367 | 690 pthread_create (&tid, NULL, _gftpui_transfer_files, tdata); |
1 | 691 } |
692 } | |
693 | |
694 | |
695 static void | |
753 | 696 _setup_dlstr (gftp_transfer * tdata, gftp_file * fle, char *dlstr, |
697 size_t dlstr_len) | |
698 { | |
767 | 699 int hours, mins, secs, stalled, usesentdescr; |
753 | 700 unsigned long remaining_secs, lkbs; |
701 char gotstr[50], ofstr[50]; | |
702 struct timeval tv; | |
703 | |
767 | 704 stalled = 1; |
753 | 705 gettimeofday (&tv, NULL); |
706 usesentdescr = (tdata->fromreq->protonum == GFTP_LOCAL_NUM); | |
707 | |
708 insert_commas (fle->size, ofstr, sizeof (ofstr)); | |
709 insert_commas (tdata->curtrans + tdata->curresumed, gotstr, sizeof (gotstr)); | |
710 | |
711 if (tv.tv_sec - tdata->lasttime.tv_sec <= 5) | |
712 { | |
767 | 713 remaining_secs = (fle->size - tdata->curtrans - tdata->curresumed) / 1024; |
714 | |
715 lkbs = (unsigned long) tdata->kbs; | |
716 if (lkbs > 0) | |
717 remaining_secs /= lkbs; | |
753 | 718 |
767 | 719 hours = remaining_secs / 3600; |
720 remaining_secs -= hours * 3600; | |
721 mins = remaining_secs / 60; | |
722 remaining_secs -= mins * 60; | |
723 secs = remaining_secs; | |
753 | 724 |
725 if (!(hours < 0 || mins < 0 || secs < 0)) | |
726 { | |
767 | 727 stalled = 0; |
753 | 728 if (usesentdescr) |
729 { | |
730 g_snprintf (dlstr, dlstr_len, | |
731 _("Sent %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
732 } | |
733 else | |
734 { | |
735 g_snprintf (dlstr, dlstr_len, | |
736 _("Recv %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
737 } | |
738 } | |
739 } | |
740 | |
767 | 741 if (stalled) |
753 | 742 { |
743 tdata->stalled = 1; | |
744 if (usesentdescr) | |
745 { | |
746 g_snprintf (dlstr, dlstr_len, | |
747 _("Sent %s of %s, transfer stalled, unknown time remaining"), | |
748 gotstr, ofstr); | |
749 } | |
750 else | |
751 { | |
752 g_snprintf (dlstr, dlstr_len, | |
753 _("Recv %s of %s, transfer stalled, unknown time remaining"), | |
754 gotstr, ofstr); | |
755 } | |
756 } | |
757 } | |
758 | |
759 | |
760 static void | |
1 | 761 update_file_status (gftp_transfer * tdata) |
762 { | |
753 | 763 char totstr[150], winstr[150], dlstr[150]; |
246 | 764 unsigned long remaining_secs, lkbs; |
767 | 765 int hours, mins, secs, pcent; |
463 | 766 intptr_t show_trans_in_title; |
1 | 767 gftp_file * tempfle; |
320 | 768 |
129 | 769 g_static_mutex_lock (&tdata->statmutex); |
1 | 770 tempfle = tdata->curfle->data; |
771 | |
220 | 772 remaining_secs = (tdata->total_bytes - tdata->trans_bytes - tdata->resumed_bytes) / 1024; |
246 | 773 |
774 lkbs = (unsigned long) tdata->kbs; | |
775 if (lkbs > 0) | |
776 remaining_secs /= lkbs; | |
1 | 777 |
220 | 778 hours = remaining_secs / 3600; |
779 remaining_secs -= hours * 3600; | |
780 mins = remaining_secs / 60; | |
781 remaining_secs -= mins * 60; | |
782 secs = remaining_secs; | |
1 | 783 |
784 if (hours < 0 || mins < 0 || secs < 0) | |
785 { | |
129 | 786 g_static_mutex_unlock (&tdata->statmutex); |
1 | 787 return; |
788 } | |
789 | |
246 | 790 if ((double) tdata->total_bytes > 0) |
791 pcent = (int) ((double) (tdata->trans_bytes + tdata->resumed_bytes) / (double) tdata->total_bytes * 100.0); | |
792 else | |
1 | 793 pcent = 0; |
794 | |
602 | 795 if (pcent > 100) |
796 g_snprintf (totstr, sizeof (totstr), | |
797 _("Unknown percentage complete. (File %ld of %ld)"), | |
798 tdata->current_file_number, tdata->numdirs + tdata->numfiles); | |
799 else | |
800 g_snprintf (totstr, sizeof (totstr), | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
801 _("%d%% complete, %02d:%02d:%02d est. time remaining. (File %ld of %ld)"), |
1 | 802 pcent, hours, mins, secs, tdata->current_file_number, |
803 tdata->numdirs + tdata->numfiles); | |
804 | |
805 *dlstr = '\0'; | |
806 if (!tdata->stalled) | |
753 | 807 _setup_dlstr (tdata, tempfle, dlstr, sizeof (dlstr)); |
1 | 808 |
129 | 809 g_static_mutex_unlock (&tdata->statmutex); |
1 | 810 |
129 | 811 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr); |
320 | 812 |
813 gftp_lookup_global_option ("show_trans_in_title", &show_trans_in_title); | |
814 if (gftp_file_transfers->data == tdata && show_trans_in_title) | |
815 { | |
816 g_snprintf (winstr, sizeof(winstr), "%s: %s", gftp_version, totstr); | |
817 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), | |
818 winstr); | |
819 } | |
1 | 820 |
821 if (*dlstr != '\0') | |
129 | 822 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr); |
1 | 823 } |
824 | |
377 | 825 |
56 | 826 static void |
827 update_window_transfer_bytes (gftp_window_data * wdata) | |
828 { | |
829 char *tempstr, *temp1str; | |
830 | |
831 if (wdata->request->gotbytes == -1) | |
832 { | |
833 update_window_info (); | |
834 wdata->request->gotbytes = 0; | |
835 } | |
836 else | |
837 { | |
838 tempstr = insert_commas (wdata->request->gotbytes, NULL, 0); | |
839 temp1str = g_strdup_printf (_("Retrieving file names...%s bytes"), | |
840 tempstr); | |
841 gtk_label_set (GTK_LABEL (wdata->hoststxt), temp1str); | |
842 g_free (tempstr); | |
843 g_free (temp1str); | |
844 } | |
845 } | |
846 | |
1 | 847 |
48 | 848 gint |
849 update_downloads (gpointer data) | |
850 { | |
433 | 851 intptr_t do_one_transfer_at_a_time, start_transfers; |
48 | 852 GList * templist, * next; |
853 gftp_transfer * tdata; | |
854 | |
129 | 855 if (gftp_file_transfer_logs != NULL) |
48 | 856 display_cached_logs (); |
857 | |
56 | 858 if (window1.request->gotbytes != 0) |
859 update_window_transfer_bytes (&window1); | |
48 | 860 if (window2.request->gotbytes != 0) |
56 | 861 update_window_transfer_bytes (&window2); |
48 | 862 |
470 | 863 if (gftpui_common_child_process_done) |
48 | 864 check_done_process (); |
865 | |
129 | 866 for (templist = gftp_file_transfers; templist != NULL;) |
48 | 867 { |
868 tdata = templist->data; | |
869 if (tdata->ready) | |
870 { | |
129 | 871 g_static_mutex_lock (&tdata->structmutex); |
48 | 872 |
873 if (tdata->next_file) | |
874 on_next_transfer (tdata); | |
875 else if (tdata->show) | |
876 show_transfer (tdata); | |
877 else if (tdata->done) | |
878 { | |
879 next = templist->next; | |
129 | 880 g_static_mutex_unlock (&tdata->structmutex); |
48 | 881 transfer_done (templist); |
882 templist = next; | |
883 continue; | |
884 } | |
885 | |
886 if (tdata->curfle != NULL) | |
887 { | |
151 | 888 gftp_lookup_global_option ("one_transfer", |
129 | 889 &do_one_transfer_at_a_time); |
433 | 890 gftp_lookup_global_option ("start_transfers", &start_transfers); |
129 | 891 |
433 | 892 if (!tdata->started && start_transfers && |
129 | 893 (num_transfers_in_progress == 0 || !do_one_transfer_at_a_time)) |
48 | 894 create_transfer (tdata); |
895 | |
896 if (tdata->started) | |
897 update_file_status (tdata); | |
898 } | |
129 | 899 g_static_mutex_unlock (&tdata->structmutex); |
48 | 900 } |
901 templist = templist->next; | |
902 } | |
903 | |
904 gtk_timeout_add (500, update_downloads, NULL); | |
905 return (0); | |
906 } | |
907 | |
908 | |
1 | 909 void |
910 start_transfer (gpointer data) | |
911 { | |
367 | 912 gftpui_common_curtrans_data * transdata; |
1 | 913 GtkCTreeNode * node; |
914 | |
915 if (GTK_CLIST (dlwdw)->selection == NULL) | |
916 { | |
677 | 917 ftp_log (gftp_logging_error, NULL, |
1 | 918 _("There are no file transfers selected\n")); |
919 return; | |
920 } | |
921 node = GTK_CLIST (dlwdw)->selection->data; | |
922 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
923 | |
129 | 924 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 925 if (!transdata->transfer->started) |
926 create_transfer (transdata->transfer); | |
129 | 927 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 928 } |
929 | |
930 | |
931 void | |
932 stop_transfer (gpointer data) | |
933 { | |
367 | 934 gftpui_common_curtrans_data * transdata; |
1 | 935 GtkCTreeNode * node; |
936 | |
937 if (GTK_CLIST (dlwdw)->selection == NULL) | |
938 { | |
677 | 939 ftp_log (gftp_logging_error, NULL, |
1 | 940 _("There are no file transfers selected\n")); |
941 return; | |
942 } | |
943 node = GTK_CLIST (dlwdw)->selection->data; | |
944 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
945 | |
129 | 946 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 947 if (transdata->transfer->started) |
948 { | |
949 transdata->transfer->cancel = 1; | |
42 | 950 transdata->transfer->fromreq->cancel = 1; |
951 transdata->transfer->toreq->cancel = 1; | |
1 | 952 transdata->transfer->skip_file = 0; |
953 } | |
954 else | |
955 transdata->transfer->done = 1; | |
129 | 956 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 957 |
1 | 958 ftp_log (gftp_logging_misc, NULL, _("Stopping the transfer on host %s\n"), |
959 transdata->transfer->fromreq->hostname); | |
960 } | |
961 | |
962 | |
963 void | |
964 skip_transfer (gpointer data) | |
965 { | |
367 | 966 gftpui_common_curtrans_data * transdata; |
1 | 967 GtkCTreeNode * node; |
968 gftp_file * curfle; | |
40 | 969 char *file; |
1 | 970 |
971 if (GTK_CLIST (dlwdw)->selection == NULL) | |
972 { | |
677 | 973 ftp_log (gftp_logging_error, NULL, |
1 | 974 _("There are no file transfers selected\n")); |
975 return; | |
976 } | |
977 node = GTK_CLIST (dlwdw)->selection->data; | |
978 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
979 | |
129 | 980 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 981 if (transdata->transfer->curfle != NULL) |
982 { | |
983 curfle = transdata->transfer->curfle->data; | |
984 if (transdata->transfer->started) | |
985 { | |
986 transdata->transfer->cancel = 1; | |
42 | 987 transdata->transfer->fromreq->cancel = 1; |
988 transdata->transfer->toreq->cancel = 1; | |
1 | 989 transdata->transfer->skip_file = 1; |
990 } | |
991 | |
992 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
40 | 993 file = curfle->file; |
1 | 994 } |
40 | 995 else |
996 file = NULL; | |
129 | 997 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 998 |
999 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), | |
1000 file, transdata->transfer->fromreq->hostname); | |
1 | 1001 } |
1002 | |
1003 | |
1004 void | |
1005 remove_file_transfer (gpointer data) | |
1006 { | |
367 | 1007 gftpui_common_curtrans_data * transdata; |
1 | 1008 GtkCTreeNode * node; |
1009 gftp_file * curfle; | |
1010 | |
1011 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1012 { | |
677 | 1013 ftp_log (gftp_logging_error, NULL, |
1 | 1014 _("There are no file transfers selected\n")); |
1015 return; | |
1016 } | |
1017 | |
1018 node = GTK_CLIST (dlwdw)->selection->data; | |
1019 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1020 | |
1021 | |
1022 if (transdata->curfle == NULL || transdata->curfle->data == NULL) | |
1023 return; | |
1024 | |
1025 curfle = transdata->curfle->data; | |
1026 | |
1027 if (curfle->transfer_action & GFTP_TRANS_ACTION_SKIP) | |
1028 return; | |
1029 | |
129 | 1030 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1031 |
1032 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
1033 | |
1034 if (transdata->transfer->started && | |
1035 transdata->curfle == transdata->transfer->curfle) | |
1036 { | |
1037 transdata->transfer->cancel = 1; | |
42 | 1038 transdata->transfer->fromreq->cancel = 1; |
1039 transdata->transfer->toreq->cancel = 1; | |
1 | 1040 transdata->transfer->skip_file = 1; |
1041 } | |
1042 else if (transdata->curfle != transdata->transfer->curfle && | |
1043 !curfle->transfer_done) | |
1044 { | |
129 | 1045 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), curfle->user_data, 1, |
1 | 1046 _("Skipped")); |
1047 transdata->transfer->total_bytes -= curfle->size; | |
1048 } | |
1049 | |
129 | 1050 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 1051 |
1 | 1052 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), |
1053 curfle->file, transdata->transfer->fromreq->hostname); | |
1054 } | |
1055 | |
1056 | |
1057 void | |
1058 move_transfer_up (gpointer data) | |
1059 { | |
1060 GList * firstentry, * secentry, * lastentry; | |
367 | 1061 gftpui_common_curtrans_data * transdata; |
1 | 1062 GtkCTreeNode * node; |
1063 | |
1064 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1065 { | |
677 | 1066 ftp_log (gftp_logging_error, NULL, |
1 | 1067 _("There are no file transfers selected\n")); |
1068 return; | |
1069 } | |
1070 node = GTK_CLIST (dlwdw)->selection->data; | |
1071 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1072 | |
1073 if (transdata->curfle == NULL) | |
1074 return; | |
1075 | |
129 | 1076 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1077 if (transdata->curfle->prev != NULL && (!transdata->transfer->started || |
1078 (transdata->transfer->curfle != transdata->curfle && | |
1079 transdata->transfer->curfle != transdata->curfle->prev))) | |
1080 { | |
1081 if (transdata->curfle->prev->prev == NULL) | |
1082 { | |
1083 firstentry = transdata->curfle->prev; | |
1084 lastentry = transdata->curfle->next; | |
1085 transdata->transfer->files = transdata->curfle; | |
1086 transdata->curfle->next = firstentry; | |
1087 transdata->transfer->files->prev = NULL; | |
1088 firstentry->prev = transdata->curfle; | |
1089 firstentry->next = lastentry; | |
1090 if (lastentry != NULL) | |
1091 lastentry->prev = firstentry; | |
1092 } | |
1093 else | |
1094 { | |
1095 firstentry = transdata->curfle->prev->prev; | |
1096 secentry = transdata->curfle->prev; | |
1097 lastentry = transdata->curfle->next; | |
1098 firstentry->next = transdata->curfle; | |
1099 transdata->curfle->prev = firstentry; | |
1100 transdata->curfle->next = secentry; | |
1101 secentry->prev = transdata->curfle; | |
1102 secentry->next = lastentry; | |
1103 if (lastentry != NULL) | |
1104 lastentry->prev = secentry; | |
1105 } | |
1106 | |
1107 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1108 ((gftp_file *) transdata->curfle->data)->user_data, |
1109 transdata->transfer->user_data, | |
1 | 1110 transdata->curfle->next != NULL ? |
129 | 1111 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1112 } |
129 | 1113 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1114 } |
1115 | |
367 | 1116 |
1 | 1117 void |
1118 move_transfer_down (gpointer data) | |
1119 { | |
1120 GList * firstentry, * secentry, * lastentry; | |
367 | 1121 gftpui_common_curtrans_data * transdata; |
1 | 1122 GtkCTreeNode * node; |
1123 | |
1124 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1125 { | |
677 | 1126 ftp_log (gftp_logging_error, NULL, |
1 | 1127 _("There are no file transfers selected\n")); |
1128 return; | |
1129 } | |
1130 node = GTK_CLIST (dlwdw)->selection->data; | |
1131 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1132 | |
1133 if (transdata->curfle == NULL) | |
1134 return; | |
1135 | |
129 | 1136 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1137 if (transdata->curfle->next != NULL && (!transdata->transfer->started || |
1138 (transdata->transfer->curfle != transdata->curfle && | |
1139 transdata->transfer->curfle != transdata->curfle->next))) | |
1140 { | |
1141 if (transdata->curfle->prev == NULL) | |
1142 { | |
1143 firstentry = transdata->curfle->next; | |
1144 lastentry = transdata->curfle->next->next; | |
1145 transdata->transfer->files = firstentry; | |
1146 transdata->transfer->files->prev = NULL; | |
1147 transdata->transfer->files->next = transdata->curfle; | |
1148 transdata->curfle->prev = transdata->transfer->files; | |
1149 transdata->curfle->next = lastentry; | |
1150 if (lastentry != NULL) | |
1151 lastentry->prev = transdata->curfle; | |
1152 } | |
1153 else | |
1154 { | |
1155 firstentry = transdata->curfle->prev; | |
1156 secentry = transdata->curfle->next; | |
1157 lastentry = transdata->curfle->next->next; | |
1158 firstentry->next = secentry; | |
1159 secentry->prev = firstentry; | |
1160 secentry->next = transdata->curfle; | |
1161 transdata->curfle->prev = secentry; | |
1162 transdata->curfle->next = lastentry; | |
1163 if (lastentry != NULL) | |
1164 lastentry->prev = transdata->curfle; | |
1165 } | |
1166 | |
1167 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1168 ((gftp_file *) transdata->curfle->data)->user_data, |
1169 transdata->transfer->user_data, | |
1 | 1170 transdata->curfle->next != NULL ? |
129 | 1171 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1172 } |
129 | 1173 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1174 } |
1175 |