Changeset 79621 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 9, 2019 1:14:53 AM (5 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/DHCPServerImpl.h
r79610 r79621 139 139 /** @name Helpers 140 140 * @{ */ 141 HRESULT i_calcLease Filename(const com::Utf8Str &aNetwork) RT_NOEXCEPT;141 HRESULT i_calcLeasesFilename(const com::Utf8Str &aNetwork) RT_NOEXCEPT; 142 142 /** @} */ 143 143 -
trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
r79610 r79621 66 66 67 67 char tempConfigFileName[RTPATH_MAX]; 68 com::Utf8Str strLease Filename;68 com::Utf8Str strLeasesFilename; 69 69 com::Utf8Str networkName; 70 70 com::Utf8Str trunkName; … … 696 696 m->trunkName = aTrunkName; 697 697 m->trunkType = aTrunkType; 698 HRESULT hrc = i_calcLease Filename(aNetworkName);698 HRESULT hrc = i_calcLeasesFilename(aNetworkName); 699 699 if (FAILED(hrc)) 700 700 return hrc; … … 732 732 pElmRoot->setAttribute("lowerIP", m->lowerIP); 733 733 pElmRoot->setAttribute("upperIP", m->upperIP); 734 pElmRoot->setAttribute("lease Filename", m->strLeaseFilename);734 pElmRoot->setAttribute("leasesFilename", m->strLeasesFilename); 735 735 736 736 /* Process global options */ … … 866 866 */ 867 867 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 868 if (m->strLease Filename.isEmpty())869 { 870 HRESULT hrc = i_calcLease Filename(m->networkName.isEmpty() ? mName : m->networkName);868 if (m->strLeasesFilename.isEmpty()) 869 { 870 HRESULT hrc = i_calcLeasesFilename(m->networkName.isEmpty() ? mName : m->networkName); 871 871 if (FAILED(hrc)) 872 872 return hrc; … … 886 886 { 887 887 xml::XmlFileParser parser; 888 parser.read(m->strLease Filename.c_str(), doc);888 parser.read(m->strLeasesFilename.c_str(), doc); 889 889 } 890 890 catch (const xml::EIPRTFailure &e) … … 912 912 } 913 913 return setErrorBoth(VBOX_E_FILE_ERROR, vrc, "Reading '%s' failed: %Rrc - %s", 914 m->strLease Filename.c_str(), vrc, e.what());914 m->strLeasesFilename.c_str(), vrc, e.what()); 915 915 } 916 916 catch (const RTCError &e) 917 917 { 918 918 if (e.what()) 919 return setError(VBOX_E_FILE_ERROR, "Reading '%s' failed: %s", m->strLease Filename.c_str(), e.what());920 return setError(VBOX_E_FILE_ERROR, "Reading '%s' failed: RTCError", m->strLease Filename.c_str());919 return setError(VBOX_E_FILE_ERROR, "Reading '%s' failed: %s", m->strLeasesFilename.c_str(), e.what()); 920 return setError(VBOX_E_FILE_ERROR, "Reading '%s' failed: RTCError", m->strLeasesFilename.c_str()); 921 921 } 922 922 catch (std::bad_alloc &) … … 927 927 { 928 928 AssertFailed(); 929 return setError(VBOX_E_FILE_ERROR, tr("Reading '%s' failed: Unexpected exception"), m->strLease Filename.c_str());929 return setError(VBOX_E_FILE_ERROR, tr("Reading '%s' failed: Unexpected exception"), m->strLeasesFilename.c_str()); 930 930 } 931 931 … … 988 988 989 989 /** 990 * Calculates and updates the value of strLease Filename given @a aNetwork.990 * Calculates and updates the value of strLeasesFilename given @a aNetwork. 991 991 */ 992 HRESULT DHCPServer::i_calcLease Filename(const com::Utf8Str &aNetwork)992 HRESULT DHCPServer::i_calcLeasesFilename(const com::Utf8Str &aNetwork) 993 993 { 994 994 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 995 995 996 996 /* The lease file must be the same as we used the last time, so careful when changing this code. */ 997 int vrc = m->strLease Filename.assignNoThrow(mVirtualBox->i_homeDir());997 int vrc = m->strLeasesFilename.assignNoThrow(mVirtualBox->i_homeDir()); 998 998 if (RT_SUCCESS(vrc)) 999 vrc = RTPathAppendCxx(m->strLease Filename, aNetwork);999 vrc = RTPathAppendCxx(m->strLeasesFilename, aNetwork); 1000 1000 if (RT_SUCCESS(vrc)) 1001 vrc = m->strLease Filename.appendNoThrow("-Dhcpd.leases");1001 vrc = m->strLeasesFilename.appendNoThrow("-Dhcpd.leases"); 1002 1002 if (RT_SUCCESS(vrc)) 1003 1003 { 1004 RTPathPurgeFilename(RTPathFilename(m->strLease Filename.mutableRaw()), RTPATH_STR_F_STYLE_HOST);1005 m->strLease Filename.jolt();1004 RTPathPurgeFilename(RTPathFilename(m->strLeasesFilename.mutableRaw()), RTPATH_STR_F_STYLE_HOST); 1005 m->strLeasesFilename.jolt(); 1006 1006 return S_OK; 1007 1007 }
Note:
See TracChangeset
for help on using the changeset viewer.