Changeset 2938
- Timestamp:
- 04/26/06 11:45:07 (3 years ago)
- Files:
-
- hydranode/hncgcomm/cgcomm.cpp (modified) (1 diff)
- hydranode/hncgcomm/cgcomm.h (modified) (1 diff)
- hydranode/hncore/cgcomm/sub_shared.cpp (modified) (3 diffs)
- hydranode/hncore/cgcomm/sub_shared.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hydranode/hncgcomm/cgcomm.cpp
r2928 r2938 753 753 } 754 754 return obj; 755 } 756 757 void SharedFilesList::addShared(const std::string &dir) { 758 std::ostringstream tmp; 759 Utils::putVal<uint8_t>(tmp, OC_ADD); 760 Utils::putVal<uint16_t>(tmp, dir.size()); 761 Utils::putVal(tmp, dir, dir.size()); 762 sendPacket(tmp.str()); 763 } 764 765 void SharedFilesList::remShared(const std::string &dir) { 766 std::ostringstream tmp; 767 Utils::putVal<uint8_t>(tmp, OC_REMOVE); 768 Utils::putVal<uint16_t>(tmp, dir.size()); 769 Utils::putVal(tmp, dir, dir.size()); 770 sendPacket(tmp.str()); 755 771 } 756 772 hydranode/hncgcomm/cgcomm.h
r2928 r2938 380 380 void getList(); 381 381 void monitor(uint32_t interval); 382 void addShared(const std::string &dir); 383 void remShared(const std::string &dir); 382 384 383 385 boost::signal<void (SharedFilePtr)> onAdded; hydranode/hncore/cgcomm/sub_shared.cpp
r2923 r2938 155 155 case OC_MONITOR: monitor(i); break; 156 156 case OC_ADD: addShared(i); break; 157 case OC_REMOVE: remShared(i); break; 157 158 default: 158 159 logDebug( … … 335 336 uint16_t len = Utils::getVal<uint16_t>(i); 336 337 std::string dir = Utils::getVal<std::string>(i, len); 338 logDebug("Adding shared directory " + dir); 337 339 try { 338 340 FilesList::instance().addSharedDir(dir, true); … … 345 347 } 346 348 347 } 348 } 349 void Shared::remShared(std::istream &i) { 350 uint16_t len = Utils::getVal<uint16_t>(i); 351 std::string dir = Utils::getVal<std::string>(i, len); 352 logDebug("Removing shared directory " + dir); 353 try { 354 FilesList::instance().remSharedDir(dir, true); 355 } catch (std::exception &e) { 356 logError( 357 boost::format("Removing shared directory %s: %s") 358 % dir % e.what() 359 ); 360 } 361 } 362 363 } // end namespace Subsystem 364 } // end namespace CGComm hydranode/hncore/cgcomm/sub_shared.h
r2850 r2938 66 66 void monitor(std::istream &i); 67 67 void addShared(std::istream &i); 68 void remShared(std::istream &i); 68 69 void sendList(); 69 70 void rebuildCache();
