summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendftp.c
Commit message (Collapse)AuthorAgeFilesLines
* ftp: Parse PWD reply according to RFCBenjamin Otte2010-04-081-19/+55
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=614401
* ftp: Add missing \n to debug messageBenjamin Otte2010-04-081-1/+1
|
* ftp: GVfsJobPull: perform any cache lookups before opening data connectionTomas Bzatek2010-02-191-10/+10
| | | | | | | | | After the delete op, cache was invalidated and an attempt was made to retrieve file size in do_pull() while data connection was already opened. This patch only moves all necessary operations before setting up actual data stream for download. Fixes bug 610395
* Handle the case where gnome-keyring has no password or no usernameBenjamin Otte2009-12-201-1/+7
| | | | Just ignore the keyring then.
* [FTP] implement default location supportBenjamin Otte2009-12-031-0/+53
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=560357 https://bugzilla.gnome.org/show_bug.cgi?id=561998
* Ensure timer_cancel is initializedAlexander Larsson2009-12-011-0/+3
| | | | Otherwise it may be used uninitialized if progress_callback is NULL
* Use FAILED_HANDLED error code when user abortsBenjamin Otte2009-10-121-1/+2
| | | | | | | | This allows Nautilus to check for FAILED_HANDLED and not displaying an error dialog to the user. Users don't like error dialogs thatdo nothing but tell them what they just did. Partial fix for https://bugzilla.gnome.org/show_bug.cgi?id=594495
* [FTP] Fix memleakBenjamin Otte2009-08-191-1/+1
|
* [FTP] plug memleak in query_infoBenjamin Otte2009-08-191-0/+1
|
* [FTP] plug memleak in login codeBenjamin Otte2009-08-191-9/+9
|
* [FTP] Properly close output stream in GVfsJobPullTomas Bzatek2009-08-101-1/+2
| | | | Don't leak output filedescriptor
* [FTP] Correctly close finished transferTomas Bzatek2009-08-101-0/+2
| | | | Re-add from commit 9c80d1ea68314ccd3b44d3a6c3761b1e42699953
* [FTP] Remove unecessary function callBenjamin Otte2009-08-101-1/+0
| | | | The matcher is ignored in g_file_info_copy_into().
* [FTP] Don't add random bytes whenever we send a progress notificationBenjamin Otte2009-08-101-2/+4
| | | | | | | | The code previously did update the write counters after being interrupted for progress updates. That would cause it to insert a random byte for every time it sent a progress update from the write loop. Noticed by Tomas Bzatek - sorry about your mp3s :(
* [FTP] Bug 590793 - Can't copy folders over FTPBenjamin Otte2009-08-061-6/+70
| | | | | Duplicate the machinery for returning the proper error when the source is a directory from gio and use it in the pull vfunc.
* [FTP] Do not lose info in cacheBenjamin Otte2009-08-061-3/+13
| | | | | As gvfs_job_enumerate_add_info() modifies the passed info, we cannot pass the cached items directly. So we do a copy instead.
* [FTP] Open source before target in pull methodBenjamin Otte2009-08-061-26/+27
| | | | | | | This way, we don't leave empty target files when opening the source resulted in an error. Also included is some code clarification.
* Bug 587484 – Interaction when unmounting mounts and misc fixesDavid Zeuthen2009-07-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Port everything to use _with_operation() variants of unmount/eject methods - Add support for g_file_poll_mountable() - new job class: GVfsJobPollMountable - Pass mount operation for unmount/eject ops on GDaemonFile and GDaemonMount - receive in the appropriate GVfsJob classes - also pass unmount flags where it was missing - port all backends to use this - Teach GMountSource and GMountOperationDBus about the new GMountOperation::show-processes signal - also provide new API - g_mount_source_is_dummy() - e.g. when the client didn't passed NULL for the GMountOperation - g_mount_source_abort() - to send the ::abort signal to the client-side GMountOperation - make the client-side of GMountSource return ::reply with NOT_HANDLED when we do an abort - Refactor the mount operation handling in GProxyVolumeMonitor - Pass mount operation for unmount/ejects in GProxyVolumeMonitor - Pass the process id of the actual reader/writer in OpenForRead and OpenForWrite daemon methods - add some private API for making the FUSE client set the pid of the POSIX client (otherwise it looks like the FUSE client is blocking) and pass the right pid. This is because the FUSE client is basically impersonating the POSIX processes. - Make the process id mentioned above available in appropriate GVfsJob classes - GVfsJobOpenForRead - GVfsJobOpenForWrite - GVfsChannel - Provide API to get a list of all blocking clients, e.g. an array of GPid - g_vfs_daemon_get_blocking_processes() - Provide convenience API to easily doing the right thing on unmount; e.g. interact with the user about blocking processes - see the gphoto2 backend for example usage - g_vfs_backend_has_blocking_processes() - g_vfs_backend_unmount_with_operation() and g_vfs_backend_unmount_with_operation_finish() - Only the gphoto2 backend supports ::show-processes right now. Support for other backends will be added shortly. - Implement support for ::show-processes in the GDU volume monitor - right now we don't support "Unmount Anyway" since it requires ABI changes in libgdu.so - this will be changed as soon as there's a new gnome-disk-utility release
* [FTP] use the EPRT feature response for EPRT support, not EPSVBenjamin Otte2009-06-171-0/+1
|
* [FTP] prepare the code for active FTP supportBenjamin Otte2009-06-151-3/+8
| | | | | | adds a bunch of new APIs necessary for supporting active FTP. These APIs don't do anything yet, as active FTP is still unsupported, it's just refactoring of code.
* [FTP] rework data connection codeBenjamin Otte2009-06-121-0/+19
| | | | | | | | | | | | | | The new code doesn't rely on funny workaround flags anymore and also doesn't set workaround flags unconditionally after any failure. It now works like this: 1) if a default method exists, try the default method. 2) if the default method failed, try all methods in order until one succeeds. 3) if any method succeeded, make it the new default method. This way, we take the proper method by default, and have a proper fallback mechanism for flaky connections/servers that sometimes fail to connect properly. Also, it's much easier to add new methods (like active FTP) later.
* [FTP] get rid of connection read/write functionsBenjamin Otte2009-06-111-10/+15
| | | | | use get_data_stream() instead and call read/write on that manually. Reduces the number of API.
* [FTP] simplify debug id APIBenjamin Otte2009-06-111-1/+1
| | | | Add a separate function for requesting the debug id
* [FTP] improve error handling for opening filesBenjamin Otte2009-06-111-3/+9
| | | | | permission handler now sets EPERM when file exists and ENOENT when it doesn't.
* [FTP] Bug 522208 - display not available error when ...Benjamin Otte2009-06-111-1/+23
| | | | | Try to return EPERM when there's a permission problem instead of returning the default error code "Operation failed".
* [FTP] use directory cache for error handlingBenjamin Otte2009-06-111-19/+18
| | | | | | | Fix FIXME that complained about not having access to the cache from error handlers. Now that we have access, we can use it to check if a file exists and/or is a directory instead of issuing some commands manually.
* [FTP] rework handling of uncached filesBenjamin Otte2009-06-111-103/+11
| | | | | | | | | | The directory cache needs a callback to lookup uncachable files. Uncachaable files are files that can be accessed but where the parent directory cannot be listed. This has to go into the directory cache, as the directory cache performs symlink resolving and looking up symlinks may encounter such files. Fixes a testcase in Andreas' test collection.
* [FTP] reuse cancellable instead of creating a new oneBenjamin Otte2009-06-111-18/+19
| | | | | | | | | | Now that a corner case in glib was fixed, it's possible to use g_cancellable_reset() and reuse the cancellable after timeouts instead of creating a new one. If you want to avoid random hangs and g_critical()s when transferring files, you need glib commit ced88fd0de4aedb537552561582875b427081eeb I've update the glib requirements accordingly.
* [FTP] fix EISDIR functionBenjamin Otte2009-06-111-1/+1
| | | | | | I'm not sure why the function claimed 550 answers to CWD commands would indicate that the path is a directory, but /dev/null certainly is not a directory.
* [FTP] make the pull callback emit progress callbacksBenjamin Otte2009-06-111-11/+76
| | | | | | | | | The progress callbacks are throttled to at most once per second to not overload dbus for very fast connections. This is implemented somewhat ugly using a cancellable that interrupts once per second to ensure progress updates are sent. If someone knows a saner approach, please tell me (or better: provide a patch).
* [FTP] almost implement pull vfuncBenjamin Otte2009-06-111-67/+196
| | | | Progress updates are not sent yet.
* [FTP] use an empty username if none was givenBenjamin Otte2009-06-111-1/+1
| | | | fixes an assertion
* [FTP] whitespace changesBenjamin Otte2009-06-111-216/+216
| | | | | - replace tabs with 8 spaces - remove spaces at end of line
* [FTP] improve debuggingBenjamin Otte2009-06-111-5/+6
| | | | | - print LIST replies again - make connections have a debug id and use it for debugging prints
* [FTP] rework cache handlingBenjamin Otte2009-06-111-627/+144
| | | | | | The cache handling has been split into a separate file and structure now. While the API still isn't perfect, it's much clearer than before. It's also faster when looking up lots of symlinks.
* [FTP] introduce GVfsFtpTaskBenjamin Otte2009-06-111-1188/+423
| | | | | | | | | | | | | split out the old FtpConnection struct into a separate GVfsFtpTask structure that acts as a one-stop solution to vfuncs. It keeps track of all important structures: - the backend - the current job - the potential connection to the server - the error state during the lifetime of a backend vfunc and supplies convenience functions to ease implementing these vfuncs. The API of gvfsftptask.h is documented.
* [FTP] split out file codeBenjamin Otte2009-06-111-197/+123
| | | | | Next step in cleaning up the ftp backend: Split out FtpFile, which is used for the proper translation between FTP paths and gvfs paths.
* [FTP] split out connection codeBenjamin Otte2009-06-111-217/+73
| | | | | | | | | | | | | | | the current FtpConnection object is not flexible enough. It is doing too many things at once, namely: 1) handling a physical connection to the ftp server 2) handling a GVfsJob's lifetime Also, the file gvfsbackendftp.c is too big, counting >2000 lines. This is the first step in an attempt to separate these two things. It splits out the physical connection into different files and makes the old FtpConnection code use this instead. A side effect of this is that it includes a change so that reading lines is now done with a GDataInputStream instead of manually, as suggested by Alex.
* [FTP] clarify codeBenjamin Otte2009-05-261-44/+44
| | | | | | | | | | | | | | | | | | | | Don't use: if (error) /* error handling */ else /* normal code */; return; Instead use: if (error) { /* error handling */ return; } /* normal code */ return; This avoids lots of indentation for normal code and clarifies what the default flow of the code is.
* [FTP] ensure the same remote address is used for all connectionsBenjamin Otte2009-05-261-4/+24
| | | | | | | Save the address of the current connection, so that for future connections, we are sure to connect to the same machine. The idea here is to avoid using mirrors that have a different state, which might cause Heisenbugs.
* [FTP] make ftp backend use gnio instead of libsoupBenjamin Otte2009-05-261-211/+216
| | | | | | This removes all traces of libsoup and uses gnio replacement functions instead. Note that various things have subtle differences, so expect new bugs.
* [FTP] rework creating the root file infoBenjamin Otte2009-05-261-30/+27
| | | | | | There is no need to make the root file info backend specific, as it just returns a bunch of default values anyway. Also, we want to use the host display name in there.
* [FTP] keep the host's display name aroundBenjamin Otte2009-05-261-16/+12
| | | | | Previously we used soup_address_get_name() to query the host name on demand, but this will not be possible with gnio.
* [FTP] rework directory listingBenjamin Otte2009-05-261-88/+91
| | | | | | | | This is in preparation to both making directory listing caches simpler and to prepare for a gnio switch. The code gets rid of reading the directory listing line by line and instead reads it as one big chunk and splits it into lines upon parsing.
* Use new race-free cancellable signal connect APIs (#572844)Alexander Larsson2009-05-151-7/+9
|
* [ftp] This data connection close isn't neededBenjamin Otte2009-05-131-1/+0
| | | | | | While it oesn't hurt either, I'm removing it because it violates the rule that data connections should be closed before receiving the reply indicating the transfer is done on the command connection.
* FTP: parse file sizes > 4GB correctlyTomas Bzatek2009-05-071-2/+2
| | | | | | | Use 64-bit strtoull() instead of 32-bit strtoul() when converting string to number. https://bugzilla.redhat.com/show_bug.cgi?id=499286
* split create_file_info() functionBenjamin Otte2009-04-261-40/+54
| | | | | The previous function was looking ugly due to early returns. This caused leaks and made it hard to read.
* ftp: try to find hidden file/dir even when there's nothing to enumerate.Andreas Henriksson2009-04-261-50/+52
| | | | | | Don't bail out early, always try to find hidden files directories. Fixes case when there's a symlink to a subdir of a hidden directory which we can't enumerate. (#559142)
* Bug 580125 – Logging in to a FTP server only works for the 2nd attemptBenjamin Otte2009-04-261-6/+9
| | | | | | | | | | Various fixes for sending the OPTS command: 1) only send it after we're sure we've read the FEAT response (which moves it to after the login) 2) ignore potential errors from the OPTS command Also fixes: Bug 580124 – Copying from FTP crashes