1616namespace Protest . Tasks ;
1717
1818internal static class Watchdog {
19- private const long WEEK_IN_TICKS = 6_048_000_000_000L ;
19+ private const long WEEK_IN_TICKS = 6_048_000_000_000L ;
2020 private const long FIVE_MINUTE_IN_TICKS = 3_000_000_000L ;
21- private const long MINUTE_IN_TICKS = 600_000_000L ;
22- private const int FIVE_MINUTE_IN_MILLI = 300_000 ;
21+ private const long MINUTE_IN_TICKS = 600_000_000L ;
22+ private const int FIVE_MINUTE_IN_MILLI = 300_000 ;
2323
2424 public enum WatcherType : byte {
2525 icmp ,
@@ -296,8 +296,7 @@ private static short CheckHttp(Watcher watcher) {
296296 int statusCode = ( int ) response . StatusCode ;
297297 int category = statusCode / 100 - 1 ;
298298
299- if ( watcher . httpstatus . Length < category )
300- continue ;
299+ if ( watcher . httpstatus . Length < category ) continue ;
301300
302301 if ( watcher . httpstatus [ category ] ) {
303302 result = 0 ;
@@ -362,7 +361,7 @@ private static short CheckHttpKeyword(Watcher watcher) {
362361 }
363362
364363 private static short CheckTls ( Watcher watcher ) {
365- short result = - 1 ;
364+ short result = short . MaxValue ;
366365
367366 using HttpClientHandler handler = new HttpClientHandler ( ) ;
368367 handler . ServerCertificateCustomValidationCallback = ( request , cert , chain , errors ) => {
@@ -390,8 +389,7 @@ private static short CheckTls(Watcher watcher) {
390389 }
391390 catch { }
392391
393- if ( result == short . MaxValue )
394- continue ;
392+ if ( result == short . MaxValue ) continue ;
395393 break ;
396394 }
397395
@@ -642,7 +640,7 @@ public static void SendSmtpNotification(Watcher watcher, Notification notificati
642640 switch ( watcher . type ) {
643641 case WatcherType . icmp :
644642 if ( status < 0 ) {
645- body . Append ( $ "<b>{ watcher . target } </b> stoped responding to ICMP requests.") ;
643+ body . Append ( $ "<b>{ watcher . target } </b> stopped responding to ICMP requests.") ;
646644 }
647645 else {
648646 body . Append ( $ "<b>{ watcher . target } </b> is now responding to ICMP requests.") ;
@@ -651,7 +649,7 @@ public static void SendSmtpNotification(Watcher watcher, Notification notificati
651649
652650 case WatcherType . tcp :
653651 if ( status < 0 ) {
654- body . Append ( $ "<b>{ watcher . target } </b> stoped listening on TCP port { watcher . port } .") ;
652+ body . Append ( $ "<b>{ watcher . target } </b> stopped listening on TCP port { watcher . port } .") ;
655653 }
656654 else {
657655 body . Append ( $ "<b>{ watcher . target } </b> is now listening on TCP port { watcher . port } .") ;
0 commit comments