[Spice-devel] [phodav PATCH 6/7 v3] spice-webdavd-windows: Check for mapped shared folder

Lukas Venhoda lvenhoda at redhat.com
Thu Mar 24 15:19:01 UTC 2016


Hi,

On Thu, Mar 24, 2016 at 10:46 AM, Victor Toso <lists at victortoso.com> wrote:

> Hi,
>
> On Thu, Mar 17, 2016 at 02:47:50PM +0100, Lukas Venhoda wrote:
> > Check whether Spice Folder is already mapped.
> > If yes, don't try to map another one.
>
> I have found some issue with this. If I disconnect a session that
> was sharing the folder (~/public) and connect again and start sharing
> (~/downloads) what should happen?
>
> It gets slow and the sharing did not really work in the second time but
> it could be due another issue (I was running with valgrind too!)
>
> Anyway, if we have a new connection we might assume that old map does
> not work anymore and unmap it...
>
>
Yes, this would be better, but it would require VDAgent integration to
check,
when user connects, or disconnects.


> > +static gboolean
> > +is_spice_folder_mapped(void)
> > +{
>

 *snip*


> > +  for (i = 0; i < 26; i++)
> > +  {
> > +    mask = max_mask >> i;
> > +    if (drives & mask)
> > +    {
> > +      local_name[0] = 'z' - i;
> > +      retval = WNetGetConnection (local_name, remote_name,
> (LPDWORD)&size);
> > +      if (retval == NO_ERROR)
> > +      {
> > +        if (strncmp (remote_name, "\\\\localhost at 9843\\DavWWWRoot",
> 28) == 0)
>
> I think the port can be changed (--port) so, better not to hardcode it.
>

changed

-- 
Lukas Venhoda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160324/a80eae32/attachment-0001.html>


More information about the Spice-devel mailing list