[21a2b73] master: Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...

Bastien Montagne noreply at git.blender.org
Tue Feb 17 19:17:17 CET 2015


Commit: 21a2b73a1e0eff0f48fe93161779bd71f8f141f7
Author: Bastien Montagne
Date:   Tue Feb 17 19:11:47 2015 +0100
Branches: master
https://developer.blender.org/rB21a2b73a1e0eff0f48fe93161779bd71f8f141f7

Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...

For now, just always consider those floppy entries ("A:\" and "B:\") as valid... sigh.

===================================================================

M	source/blender/editors/space_file/fsmenu.c

===================================================================

diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index f717573..0cbb31b 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -219,6 +219,20 @@ void ED_fsmenu_entry_set_name(struct FSMenuEntry *fsentry, const char *name)
 void fsmenu_entry_refresh_valid(struct FSMenuEntry *fsentry)
 {
 	if (fsentry->path && fsentry->path[0]) {
+		/* XXX Special case, always consider those as valid.
+		 *     Thanks to Windows, which can spend five seconds to perform a mere stat() call on those paths...
+		 *     See T43684.
+		 */
+		const char *exceptions[] = {"A:\\", "B:\\", NULL};
+		const size_t exceptions_len[] = {strlen(exceptions[0]), strlen(exceptions[1]), 0};
+		int i;
+
+		for (i = 0; exceptions[i]; i++) {
+			if (STREQLEN(fsentry->path, exceptions[i], exceptions_len[i])) {
+				fsentry->valid = true;
+				return;
+			}
+		}
 		fsentry->valid = BLI_is_dir(fsentry->path);
 	}
 	else {




More information about the Bf-blender-cvs mailing list