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