Revision: 44672
http://brlcad.svn.sourceforge.net/brlcad/?rev=44672&view=rev
Author: davidloman
Date: 2011-05-24 19:29:45 +0000 (Tue, 24 May 2011)
Log Message:
-----------
Make DataManager respond to Directory Listing request. Also check for error
return values and send FailureMsgs when appropriate.
Modified Paths:
--------------
geomcore/trunk/src/GS/DataManager.cxx
Modified: geomcore/trunk/src/GS/DataManager.cxx
===================================================================
--- geomcore/trunk/src/GS/DataManager.cxx 2011-05-24 19:26:56 UTC (rev
44671)
+++ geomcore/trunk/src/GS/DataManager.cxx 2011-05-24 19:29:45 UTC (rev
44672)
@@ -69,6 +69,8 @@
{
case DIRLISTREQ:
{
+ this->log->logINFO("DataManager", "Recv'd a DirectoryList Request from:
" + msg->getOrigin()->getRemoteNodeName());
+ this->handleDirListReqMsg((DirListReqMsg*) msg);
return true;
}
case DIRLISTRES:
@@ -109,8 +111,18 @@
std::string path = msg->getPath();
std::list<std::string> items;
- this->datasource->getListing(path, &items);
+ int retVal = this->datasource->getListing(path, &items);
+ if (retVal < 0) {
+ FailureMsg fail(msg,42);
+ origin->send(&fail);
+ return;
+ }
+
+ /* filter out .. and . */
+ items.remove("..");
+ items.remove(".");
+
DirListResMsg response(msg, path, &items);
origin->send(&response);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits