summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorSimon Rettberg2020-03-31 17:38:24 +0200
committerSimon Rettberg2020-03-31 17:38:24 +0200
commitbd85f127c62a490e94752f82e6d9d9778a03f1f1 (patch)
treeb824c66c1d0245b60f979e1dc931feac749db029 /src/server
parent[BENCH] fix wrong operator precedence (diff)
downloaddnbd3-bd85f127c62a490e94752f82e6d9d9778a03f1f1.tar.gz
dnbd3-bd85f127c62a490e94752f82e6d9d9778a03f1f1.tar.xz
dnbd3-bd85f127c62a490e94752f82e6d9d9778a03f1f1.zip
[SERVER] Check local and remote for updates on rid == 0
Diffstat (limited to 'src/server')
-rw-r--r--src/server/image.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/image.c b/src/server/image.c
index 2273dc2..7eeca76 100644
--- a/src/server/image.c
+++ b/src/server/image.c
@@ -1176,14 +1176,18 @@ dnbd3_image_t* image_getOrLoad(char * const name, const uint16_t revision)
// Sanity check
if ( len == 0 || name[len - 1] == '/' || name[0] == '/'
|| name[0] == '.' || strstr( name, "/." ) != NULL ) return NULL;
- // If in proxy mode, check with upstream server first
+ // Re-check latest local revision
+ image = loadImageServer( name, revision );
+ // If in proxy mode, check with upstream servers
if ( _isProxy ) {
+ // Forget the locally loaded one
+ image_release( image );
+ // Check with upstream - if unsuccessful, will return the same
+ // as loadImageServer did
image = loadImageProxy( name, revision, len );
- if ( image != NULL )
- return image;
}
// Lookup on local storage
- return loadImageServer( name, revision );
+ return image;
}
/**