On Thu, 12 Aug 2010, Robert Norris wrote:

> >> 1) http://github.com/jocelynj/viking/commits/dragdrop
> >>
> >> This branch contains one commit to make map drag and drop working
> >> correctly - this means that when you click on the map, and keep the
> >> button pressed, you should have the map moving with the mouse, like
> >> on Openstreetmap website.
> >>
> >> I haven't check if this commit degrades viking performance, but I don't
> >> think so.
> >
> > short notice, that this seems to result in map tiles being downloaded
> > multiple times, when scrolling over a non-cached region with auto-download
> > being on. I see multiple requests (short look at the logfile reveals up to
> > ten) for the same tile, hitting the server at the same second, which is
> > pretty bad.
> 
> I can get similar behaviour if one zooms in/out quickly (compared to the 
> speed of the mapserver), so I don't think this is particularly because 
> of the this patch - just another way to request multiple tiles quickly.
> 
> 
> Therefore I think Viking just adds it into the download queue without 
> checking whether it is already in the process of requesting it. I'm not 
> familiar with this part of the code, so I'm not actually sure .

Hi,

this is true, I was thinking the same. The dragdrop change isn't the 
culprit by itself, but the tile locking isn't working as it should. It 
requires the change below, which can be pulled from

  git://git.stealer.net/viking.git for-upstream

Sven

>From 0c2ef7eaf4461a63565cbd895ca629d6938dc61f Mon Sep 17 00:00:00 2001
From: Sven Wegener <sven.wege...@stealer.net>
Date: Sat, 14 Aug 2010 15:59:17 +0200
Subject: [PATCH] Fix internal tile locking

g_list_find() only compares the pointer and not the filename it points
to, use g_list_find_custom() with g_strcmp0() to actually check for the
filename.

Signed-off-by: Sven Wegener <sven.wege...@stealer.net>
---
 src/download.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/download.c b/src/download.c
index 065aba1..ed6fc98 100644
--- a/src/download.c
+++ b/src/download.c
@@ -124,7 +124,7 @@ static gboolean lock_file(const char *fn)
 {
        gboolean locked = FALSE;
        g_mutex_lock(file_list_mutex);
-       if (g_list_find(file_list, fn) == NULL)
+       if (g_list_find_custom(file_list, fn, g_strcmp0) == NULL)
        {
                // The filename is not yet locked
                file_list = g_list_append(file_list, (gpointer)fn),

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to