diff options
| author | rdna <[email protected]> | 2022-02-10 16:48:05 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:05 +0300 | 
| commit | 37a2795395ba606e239b750ff2afb17905274ec4 (patch) | |
| tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/messagebus/config/session_config.cpp | |
| parent | 7804d69d166cc162c0be19dafd698a6ad7e42b25 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/config/session_config.cpp')
| -rw-r--r-- | library/cpp/messagebus/config/session_config.cpp | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/library/cpp/messagebus/config/session_config.cpp b/library/cpp/messagebus/config/session_config.cpp index 0679945dcc3..fbbbb106c9d 100644 --- a/library/cpp/messagebus/config/session_config.cpp +++ b/library/cpp/messagebus/config/session_config.cpp @@ -1,7 +1,7 @@  #include "session_config.h" -#include <util/generic/strbuf.h>  -#include <util/string/hex.h>  +#include <util/generic/strbuf.h> +#include <util/string/hex.h>  using namespace NBus; @@ -26,20 +26,20 @@ static int ParseDurationForMessageBus(const char* option) {      return TDuration::Parse(option).MilliSeconds();  } -static int ParseToSForMessageBus(const char* option) {  -    int tos;  -    TStringBuf str(option);  +static int ParseToSForMessageBus(const char* option) { +    int tos; +    TStringBuf str(option);      if (str.StartsWith("0x")) { -        str = str.Tail(2);  +        str = str.Tail(2);          Y_VERIFY(str.length() == 2, "ToS must be a number between 0x00 and 0xFF");          tos = String2Byte(str.data()); -    } else {  -        tos = FromString<int>(option);  -    }  +    } else { +        tos = FromString<int>(option); +    }      Y_VERIFY(tos >= 0 && tos <= 255, "ToS must be between 0x00 and 0xFF"); -    return tos;  -}  -  +    return tos; +} +  template <class T>  static T ParseWithKmgSuffixT(const char* option) {      TStringBuf str(option); | 
