Mercurial > gftp.yaz
annotate src/gtk/transfer.c @ 785:19aaa1571cc8
2006-7-21 Brian Masney <masneyb@gftp.org>
* src/gtk/transfer.c (transfer_done) - fixed race condition that
would occur when selecting Stop Transfer and then Start Transfer
(from Matthieu Crapet <mcrapet@gmail.com>) (closes #348140)
author | masneyb |
---|---|
date | Fri, 21 Jul 2006 13:30:12 +0000 |
parents | cf2a51deefd8 |
children | fbc903d84577 |
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 | |
785 | 621 if ((!tdata->show && tdata->started) || |
622 (tdata->done && !tdata->started)) | |
1 | 623 { |
129 | 624 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
625 tdata->user_data); | |
1 | 626 if (transdata != NULL) |
627 g_free (transdata); | |
628 | |
629 for (templist = tdata->files; templist != NULL; templist = templist->next) | |
630 { | |
631 tempfle = templist->data; | |
129 | 632 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), |
633 tempfle->user_data); | |
1 | 634 if (transdata != NULL) |
635 g_free (transdata); | |
636 } | |
637 | |
129 | 638 gtk_ctree_remove_node (GTK_CTREE (dlwdw), tdata->user_data); |
1 | 639 } |
129 | 640 |
367 | 641 g_static_mutex_lock (&gftpui_common_transfer_mutex); |
129 | 642 gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node); |
367 | 643 g_static_mutex_unlock (&gftpui_common_transfer_mutex); |
644 | |
320 | 645 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), |
646 gftp_version); | |
129 | 647 |
1 | 648 free_tdata (tdata); |
649 } | |
650 | |
651 | |
367 | 652 static void * |
653 _gftpui_transfer_files (void *data) | |
654 { | |
655 int ret; | |
656 | |
657 pthread_detach (pthread_self ()); | |
658 ret = gftpui_common_transfer_files (data); | |
659 return (GINT_TO_POINTER(ret)); | |
660 } | |
661 | |
662 | |
1 | 663 static void |
664 create_transfer (gftp_transfer * tdata) | |
665 { | |
666 pthread_t tid; | |
667 | |
668 if (!tdata->fromreq->stopable) | |
669 { | |
297 | 670 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->fromwdata, |
671 tdata->fromreq)) | |
672 { | |
673 gftp_swap_socks (tdata->fromreq, | |
674 ((gftp_window_data *) tdata->fromwdata)->request); | |
675 update_window (tdata->fromwdata); | |
676 } | |
677 | |
678 if (GFTP_IS_SAME_HOST_START_TRANS ((gftp_window_data *) tdata->towdata, | |
679 tdata->toreq)) | |
680 { | |
63 | 681 gftp_swap_socks (tdata->toreq, |
682 ((gftp_window_data *) tdata->towdata)->request); | |
297 | 683 update_window (tdata->towdata); |
1 | 684 } |
297 | 685 |
129 | 686 num_transfers_in_progress++; |
1 | 687 tdata->started = 1; |
688 tdata->stalled = 1; | |
129 | 689 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, |
1 | 690 _("Connecting...")); |
367 | 691 pthread_create (&tid, NULL, _gftpui_transfer_files, tdata); |
1 | 692 } |
693 } | |
694 | |
695 | |
696 static void | |
753 | 697 _setup_dlstr (gftp_transfer * tdata, gftp_file * fle, char *dlstr, |
698 size_t dlstr_len) | |
699 { | |
767 | 700 int hours, mins, secs, stalled, usesentdescr; |
753 | 701 unsigned long remaining_secs, lkbs; |
702 char gotstr[50], ofstr[50]; | |
703 struct timeval tv; | |
704 | |
767 | 705 stalled = 1; |
753 | 706 gettimeofday (&tv, NULL); |
707 usesentdescr = (tdata->fromreq->protonum == GFTP_LOCAL_NUM); | |
708 | |
709 insert_commas (fle->size, ofstr, sizeof (ofstr)); | |
710 insert_commas (tdata->curtrans + tdata->curresumed, gotstr, sizeof (gotstr)); | |
711 | |
712 if (tv.tv_sec - tdata->lasttime.tv_sec <= 5) | |
713 { | |
767 | 714 remaining_secs = (fle->size - tdata->curtrans - tdata->curresumed) / 1024; |
715 | |
716 lkbs = (unsigned long) tdata->kbs; | |
717 if (lkbs > 0) | |
718 remaining_secs /= lkbs; | |
753 | 719 |
767 | 720 hours = remaining_secs / 3600; |
721 remaining_secs -= hours * 3600; | |
722 mins = remaining_secs / 60; | |
723 remaining_secs -= mins * 60; | |
724 secs = remaining_secs; | |
753 | 725 |
726 if (!(hours < 0 || mins < 0 || secs < 0)) | |
727 { | |
767 | 728 stalled = 0; |
753 | 729 if (usesentdescr) |
730 { | |
731 g_snprintf (dlstr, dlstr_len, | |
732 _("Sent %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
733 } | |
734 else | |
735 { | |
736 g_snprintf (dlstr, dlstr_len, | |
737 _("Recv %s of %s at %.2fKB/s, %02d:%02d:%02d est. time remaining"), gotstr, ofstr, tdata->kbs, hours, mins, secs); | |
738 } | |
739 } | |
740 } | |
741 | |
767 | 742 if (stalled) |
753 | 743 { |
744 tdata->stalled = 1; | |
745 if (usesentdescr) | |
746 { | |
747 g_snprintf (dlstr, dlstr_len, | |
748 _("Sent %s of %s, transfer stalled, unknown time remaining"), | |
749 gotstr, ofstr); | |
750 } | |
751 else | |
752 { | |
753 g_snprintf (dlstr, dlstr_len, | |
754 _("Recv %s of %s, transfer stalled, unknown time remaining"), | |
755 gotstr, ofstr); | |
756 } | |
757 } | |
758 } | |
759 | |
760 | |
761 static void | |
1 | 762 update_file_status (gftp_transfer * tdata) |
763 { | |
753 | 764 char totstr[150], winstr[150], dlstr[150]; |
246 | 765 unsigned long remaining_secs, lkbs; |
767 | 766 int hours, mins, secs, pcent; |
463 | 767 intptr_t show_trans_in_title; |
1 | 768 gftp_file * tempfle; |
320 | 769 |
129 | 770 g_static_mutex_lock (&tdata->statmutex); |
1 | 771 tempfle = tdata->curfle->data; |
772 | |
220 | 773 remaining_secs = (tdata->total_bytes - tdata->trans_bytes - tdata->resumed_bytes) / 1024; |
246 | 774 |
775 lkbs = (unsigned long) tdata->kbs; | |
776 if (lkbs > 0) | |
777 remaining_secs /= lkbs; | |
1 | 778 |
220 | 779 hours = remaining_secs / 3600; |
780 remaining_secs -= hours * 3600; | |
781 mins = remaining_secs / 60; | |
782 remaining_secs -= mins * 60; | |
783 secs = remaining_secs; | |
1 | 784 |
785 if (hours < 0 || mins < 0 || secs < 0) | |
786 { | |
129 | 787 g_static_mutex_unlock (&tdata->statmutex); |
1 | 788 return; |
789 } | |
790 | |
246 | 791 if ((double) tdata->total_bytes > 0) |
792 pcent = (int) ((double) (tdata->trans_bytes + tdata->resumed_bytes) / (double) tdata->total_bytes * 100.0); | |
793 else | |
1 | 794 pcent = 0; |
795 | |
602 | 796 if (pcent > 100) |
797 g_snprintf (totstr, sizeof (totstr), | |
798 _("Unknown percentage complete. (File %ld of %ld)"), | |
799 tdata->current_file_number, tdata->numdirs + tdata->numfiles); | |
800 else | |
801 g_snprintf (totstr, sizeof (totstr), | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
802 _("%d%% complete, %02d:%02d:%02d est. time remaining. (File %ld of %ld)"), |
1 | 803 pcent, hours, mins, secs, tdata->current_file_number, |
804 tdata->numdirs + tdata->numfiles); | |
805 | |
806 *dlstr = '\0'; | |
807 if (!tdata->stalled) | |
753 | 808 _setup_dlstr (tdata, tempfle, dlstr, sizeof (dlstr)); |
1 | 809 |
129 | 810 g_static_mutex_unlock (&tdata->statmutex); |
1 | 811 |
129 | 812 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr); |
320 | 813 |
814 gftp_lookup_global_option ("show_trans_in_title", &show_trans_in_title); | |
815 if (gftp_file_transfers->data == tdata && show_trans_in_title) | |
816 { | |
817 g_snprintf (winstr, sizeof(winstr), "%s: %s", gftp_version, totstr); | |
818 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)), | |
819 winstr); | |
820 } | |
1 | 821 |
822 if (*dlstr != '\0') | |
129 | 823 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr); |
1 | 824 } |
825 | |
377 | 826 |
56 | 827 static void |
828 update_window_transfer_bytes (gftp_window_data * wdata) | |
829 { | |
830 char *tempstr, *temp1str; | |
831 | |
832 if (wdata->request->gotbytes == -1) | |
833 { | |
834 update_window_info (); | |
835 wdata->request->gotbytes = 0; | |
836 } | |
837 else | |
838 { | |
839 tempstr = insert_commas (wdata->request->gotbytes, NULL, 0); | |
840 temp1str = g_strdup_printf (_("Retrieving file names...%s bytes"), | |
841 tempstr); | |
842 gtk_label_set (GTK_LABEL (wdata->hoststxt), temp1str); | |
843 g_free (tempstr); | |
844 g_free (temp1str); | |
845 } | |
846 } | |
847 | |
1 | 848 |
48 | 849 gint |
850 update_downloads (gpointer data) | |
851 { | |
433 | 852 intptr_t do_one_transfer_at_a_time, start_transfers; |
48 | 853 GList * templist, * next; |
854 gftp_transfer * tdata; | |
855 | |
129 | 856 if (gftp_file_transfer_logs != NULL) |
48 | 857 display_cached_logs (); |
858 | |
56 | 859 if (window1.request->gotbytes != 0) |
860 update_window_transfer_bytes (&window1); | |
48 | 861 if (window2.request->gotbytes != 0) |
56 | 862 update_window_transfer_bytes (&window2); |
48 | 863 |
470 | 864 if (gftpui_common_child_process_done) |
48 | 865 check_done_process (); |
866 | |
129 | 867 for (templist = gftp_file_transfers; templist != NULL;) |
48 | 868 { |
869 tdata = templist->data; | |
870 if (tdata->ready) | |
871 { | |
129 | 872 g_static_mutex_lock (&tdata->structmutex); |
48 | 873 |
874 if (tdata->next_file) | |
875 on_next_transfer (tdata); | |
876 else if (tdata->show) | |
877 show_transfer (tdata); | |
878 else if (tdata->done) | |
879 { | |
880 next = templist->next; | |
129 | 881 g_static_mutex_unlock (&tdata->structmutex); |
48 | 882 transfer_done (templist); |
883 templist = next; | |
884 continue; | |
885 } | |
886 | |
887 if (tdata->curfle != NULL) | |
888 { | |
151 | 889 gftp_lookup_global_option ("one_transfer", |
129 | 890 &do_one_transfer_at_a_time); |
433 | 891 gftp_lookup_global_option ("start_transfers", &start_transfers); |
129 | 892 |
433 | 893 if (!tdata->started && start_transfers && |
129 | 894 (num_transfers_in_progress == 0 || !do_one_transfer_at_a_time)) |
48 | 895 create_transfer (tdata); |
896 | |
897 if (tdata->started) | |
898 update_file_status (tdata); | |
899 } | |
129 | 900 g_static_mutex_unlock (&tdata->structmutex); |
48 | 901 } |
902 templist = templist->next; | |
903 } | |
904 | |
905 gtk_timeout_add (500, update_downloads, NULL); | |
906 return (0); | |
907 } | |
908 | |
909 | |
1 | 910 void |
911 start_transfer (gpointer data) | |
912 { | |
367 | 913 gftpui_common_curtrans_data * transdata; |
1 | 914 GtkCTreeNode * node; |
915 | |
916 if (GTK_CLIST (dlwdw)->selection == NULL) | |
917 { | |
677 | 918 ftp_log (gftp_logging_error, NULL, |
1 | 919 _("There are no file transfers selected\n")); |
920 return; | |
921 } | |
922 node = GTK_CLIST (dlwdw)->selection->data; | |
923 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
924 | |
129 | 925 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 926 if (!transdata->transfer->started) |
927 create_transfer (transdata->transfer); | |
129 | 928 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 929 } |
930 | |
931 | |
932 void | |
933 stop_transfer (gpointer data) | |
934 { | |
367 | 935 gftpui_common_curtrans_data * transdata; |
1 | 936 GtkCTreeNode * node; |
937 | |
938 if (GTK_CLIST (dlwdw)->selection == NULL) | |
939 { | |
677 | 940 ftp_log (gftp_logging_error, NULL, |
1 | 941 _("There are no file transfers selected\n")); |
942 return; | |
943 } | |
944 node = GTK_CLIST (dlwdw)->selection->data; | |
945 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
946 | |
129 | 947 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 948 if (transdata->transfer->started) |
949 { | |
950 transdata->transfer->cancel = 1; | |
42 | 951 transdata->transfer->fromreq->cancel = 1; |
952 transdata->transfer->toreq->cancel = 1; | |
1 | 953 transdata->transfer->skip_file = 0; |
954 } | |
955 else | |
956 transdata->transfer->done = 1; | |
129 | 957 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 958 |
1 | 959 ftp_log (gftp_logging_misc, NULL, _("Stopping the transfer on host %s\n"), |
960 transdata->transfer->fromreq->hostname); | |
961 } | |
962 | |
963 | |
964 void | |
965 skip_transfer (gpointer data) | |
966 { | |
367 | 967 gftpui_common_curtrans_data * transdata; |
1 | 968 GtkCTreeNode * node; |
969 gftp_file * curfle; | |
40 | 970 char *file; |
1 | 971 |
972 if (GTK_CLIST (dlwdw)->selection == NULL) | |
973 { | |
677 | 974 ftp_log (gftp_logging_error, NULL, |
1 | 975 _("There are no file transfers selected\n")); |
976 return; | |
977 } | |
978 node = GTK_CLIST (dlwdw)->selection->data; | |
979 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
980 | |
129 | 981 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 982 if (transdata->transfer->curfle != NULL) |
983 { | |
984 curfle = transdata->transfer->curfle->data; | |
985 if (transdata->transfer->started) | |
986 { | |
987 transdata->transfer->cancel = 1; | |
42 | 988 transdata->transfer->fromreq->cancel = 1; |
989 transdata->transfer->toreq->cancel = 1; | |
1 | 990 transdata->transfer->skip_file = 1; |
991 } | |
992 | |
993 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
40 | 994 file = curfle->file; |
1 | 995 } |
40 | 996 else |
997 file = NULL; | |
129 | 998 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 999 |
1000 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), | |
1001 file, transdata->transfer->fromreq->hostname); | |
1 | 1002 } |
1003 | |
1004 | |
1005 void | |
1006 remove_file_transfer (gpointer data) | |
1007 { | |
367 | 1008 gftpui_common_curtrans_data * transdata; |
1 | 1009 GtkCTreeNode * node; |
1010 gftp_file * curfle; | |
1011 | |
1012 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1013 { | |
677 | 1014 ftp_log (gftp_logging_error, NULL, |
1 | 1015 _("There are no file transfers selected\n")); |
1016 return; | |
1017 } | |
1018 | |
1019 node = GTK_CLIST (dlwdw)->selection->data; | |
1020 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1021 | |
1022 | |
1023 if (transdata->curfle == NULL || transdata->curfle->data == NULL) | |
1024 return; | |
1025 | |
1026 curfle = transdata->curfle->data; | |
1027 | |
1028 if (curfle->transfer_action & GFTP_TRANS_ACTION_SKIP) | |
1029 return; | |
1030 | |
129 | 1031 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1032 |
1033 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; | |
1034 | |
1035 if (transdata->transfer->started && | |
1036 transdata->curfle == transdata->transfer->curfle) | |
1037 { | |
1038 transdata->transfer->cancel = 1; | |
42 | 1039 transdata->transfer->fromreq->cancel = 1; |
1040 transdata->transfer->toreq->cancel = 1; | |
1 | 1041 transdata->transfer->skip_file = 1; |
1042 } | |
1043 else if (transdata->curfle != transdata->transfer->curfle && | |
1044 !curfle->transfer_done) | |
1045 { | |
129 | 1046 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), curfle->user_data, 1, |
1 | 1047 _("Skipped")); |
1048 transdata->transfer->total_bytes -= curfle->size; | |
1049 } | |
1050 | |
129 | 1051 g_static_mutex_unlock (&transdata->transfer->structmutex); |
40 | 1052 |
1 | 1053 ftp_log (gftp_logging_misc, NULL, _("Skipping file %s on host %s\n"), |
1054 curfle->file, transdata->transfer->fromreq->hostname); | |
1055 } | |
1056 | |
1057 | |
1058 void | |
1059 move_transfer_up (gpointer data) | |
1060 { | |
1061 GList * firstentry, * secentry, * lastentry; | |
367 | 1062 gftpui_common_curtrans_data * transdata; |
1 | 1063 GtkCTreeNode * node; |
1064 | |
1065 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1066 { | |
677 | 1067 ftp_log (gftp_logging_error, NULL, |
1 | 1068 _("There are no file transfers selected\n")); |
1069 return; | |
1070 } | |
1071 node = GTK_CLIST (dlwdw)->selection->data; | |
1072 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1073 | |
1074 if (transdata->curfle == NULL) | |
1075 return; | |
1076 | |
129 | 1077 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1078 if (transdata->curfle->prev != NULL && (!transdata->transfer->started || |
1079 (transdata->transfer->curfle != transdata->curfle && | |
1080 transdata->transfer->curfle != transdata->curfle->prev))) | |
1081 { | |
1082 if (transdata->curfle->prev->prev == NULL) | |
1083 { | |
1084 firstentry = transdata->curfle->prev; | |
1085 lastentry = transdata->curfle->next; | |
1086 transdata->transfer->files = transdata->curfle; | |
1087 transdata->curfle->next = firstentry; | |
1088 transdata->transfer->files->prev = NULL; | |
1089 firstentry->prev = transdata->curfle; | |
1090 firstentry->next = lastentry; | |
1091 if (lastentry != NULL) | |
1092 lastentry->prev = firstentry; | |
1093 } | |
1094 else | |
1095 { | |
1096 firstentry = transdata->curfle->prev->prev; | |
1097 secentry = transdata->curfle->prev; | |
1098 lastentry = transdata->curfle->next; | |
1099 firstentry->next = transdata->curfle; | |
1100 transdata->curfle->prev = firstentry; | |
1101 transdata->curfle->next = secentry; | |
1102 secentry->prev = transdata->curfle; | |
1103 secentry->next = lastentry; | |
1104 if (lastentry != NULL) | |
1105 lastentry->prev = secentry; | |
1106 } | |
1107 | |
1108 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1109 ((gftp_file *) transdata->curfle->data)->user_data, |
1110 transdata->transfer->user_data, | |
1 | 1111 transdata->curfle->next != NULL ? |
129 | 1112 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1113 } |
129 | 1114 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1115 } |
1116 | |
367 | 1117 |
1 | 1118 void |
1119 move_transfer_down (gpointer data) | |
1120 { | |
1121 GList * firstentry, * secentry, * lastentry; | |
367 | 1122 gftpui_common_curtrans_data * transdata; |
1 | 1123 GtkCTreeNode * node; |
1124 | |
1125 if (GTK_CLIST (dlwdw)->selection == NULL) | |
1126 { | |
677 | 1127 ftp_log (gftp_logging_error, NULL, |
1 | 1128 _("There are no file transfers selected\n")); |
1129 return; | |
1130 } | |
1131 node = GTK_CLIST (dlwdw)->selection->data; | |
1132 transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node); | |
1133 | |
1134 if (transdata->curfle == NULL) | |
1135 return; | |
1136 | |
129 | 1137 g_static_mutex_lock (&transdata->transfer->structmutex); |
1 | 1138 if (transdata->curfle->next != NULL && (!transdata->transfer->started || |
1139 (transdata->transfer->curfle != transdata->curfle && | |
1140 transdata->transfer->curfle != transdata->curfle->next))) | |
1141 { | |
1142 if (transdata->curfle->prev == NULL) | |
1143 { | |
1144 firstentry = transdata->curfle->next; | |
1145 lastentry = transdata->curfle->next->next; | |
1146 transdata->transfer->files = firstentry; | |
1147 transdata->transfer->files->prev = NULL; | |
1148 transdata->transfer->files->next = transdata->curfle; | |
1149 transdata->curfle->prev = transdata->transfer->files; | |
1150 transdata->curfle->next = lastentry; | |
1151 if (lastentry != NULL) | |
1152 lastentry->prev = transdata->curfle; | |
1153 } | |
1154 else | |
1155 { | |
1156 firstentry = transdata->curfle->prev; | |
1157 secentry = transdata->curfle->next; | |
1158 lastentry = transdata->curfle->next->next; | |
1159 firstentry->next = secentry; | |
1160 secentry->prev = firstentry; | |
1161 secentry->next = transdata->curfle; | |
1162 transdata->curfle->prev = secentry; | |
1163 transdata->curfle->next = lastentry; | |
1164 if (lastentry != NULL) | |
1165 lastentry->prev = transdata->curfle; | |
1166 } | |
1167 | |
1168 gtk_ctree_move (GTK_CTREE (dlwdw), | |
129 | 1169 ((gftp_file *) transdata->curfle->data)->user_data, |
1170 transdata->transfer->user_data, | |
1 | 1171 transdata->curfle->next != NULL ? |
129 | 1172 ((gftp_file *) transdata->curfle->next->data)->user_data: NULL); |
1 | 1173 } |
129 | 1174 g_static_mutex_unlock (&transdata->transfer->structmutex); |
1 | 1175 } |
1176 |