[Spice-devel] [PATCH phodav 10/13] spice-win: don't assign drive_letter on error
Marc-André Lureau
marcandre.lureau at gmail.com
Thu May 23 13:40:50 UTC 2019
On Thu, May 23, 2019 at 10:37 AM Jakub Janků <jjanku at redhat.com> wrote:
>
> drive_letter should be assigned only when the mapping was successful.
>
> Signed-off-by: Jakub Janků <jjanku at redhat.com>
ack
> spice/spice-webdavd.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
> index 29058e7..f2c7f07 100644
> --- a/spice/spice-webdavd.c
> +++ b/spice/spice-webdavd.c
> @@ -910,14 +910,20 @@ map_drive_cb(GTask *task,
> break;
> }
>
> - if (map_drive (drive_letter) != ERROR_ALREADY_ASSIGNED)
> + ret = map_drive (drive_letter);
> + if (ret == ERROR_ALREADY_ASSIGNED)
> {
> - break;
> + /* try again with another letter */
> + continue;
> + }
> + if (ret != NO_ERROR)
> + {
> + drive_letter = 0;
> }
> + break;
> //TODO: After mapping, rename network drive from \\localhost at PORT\DavWWWRoot
> // to something like SPICE Shared Folder
> }
> -
> g_mutex_lock(&map_drive_data->service_data->mutex);
> map_drive_data->service_data->drive_letter = drive_letter;
> g_mutex_unlock(&map_drive_data->service_data->mutex);
> --
> 2.21.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
--
Marc-André Lureau
More information about the Spice-devel
mailing list