Skip to content

Commit 25e936a

Browse files
committed
drivers/tripplite_usb.c, UPGRADING.adoc: remove old bespoke reconnection limit tracking [#3541]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 5bd86ef commit 25e936a

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

UPGRADING.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ The new `-A filename` option defaults to trying to use a `nutauth.conf` file
7474
reading one ('none' as the legacy default). See the updated manual pages
7575
for more details. [issues #3329, #3411]
7676
77-
- `powervar_cx_usb` driver used a built-in limit on reconnection
78-
attempts after which it exited. This was revised to follow the new common
79-
setting `reconnect_max_tries` which defaults to trying indefinitely. [#3541]
77+
- The `powervar_cx_usb`, `tripplite_usb` drivers used a built-in limit on
78+
reconnection attempts after which they exited ('60' and '10' respectively).
79+
This was revised to follow the new common setting `reconnect_max_tries`,
80+
which defaults to trying indefinitely now. [#3541]
8081
8182
Changes from 2.8.4 to 2.8.5
8283
---------------------------

drivers/tripplite_usb.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ static int is_smart_protocol(void)
279279
#define MAX_RECV_TRIES 10
280280
#define RECV_WAIT_MSEC 1000 /*!< was 100 for OMNIVS; SMARTPRO units need longer */
281281

282-
#define MAX_RECONNECT_TRIES 10
283-
284282
#define DEFAULT_OFFDELAY 64 /*!< seconds (max 0xFF) */
285283
#define DEFAULT_STARTDELAY 60 /*!< seconds (max 0xFFFFFF) */
286284
#define DEFAULT_BOOTDELAY 64 /*!< seconds (max 0xFF) */
@@ -677,8 +675,6 @@ void upsdrv_initinfo(void);
677675
*/
678676
static void usb_comm_fail(int res, const char *msg)
679677
{
680-
static int try_num = 0;
681-
682678
switch(res) {
683679
case LIBUSB_ERROR_BUSY:
684680
upslogx(LOG_WARNING,
@@ -689,26 +685,18 @@ static void usb_comm_fail(int res, const char *msg)
689685
#endif
690686

691687
default:
692-
reconnect_trying(RECONNECT_TRYING);
693-
/* FIXME [#3541]: Clean up driver custom tracking and MAX tolerance */
694688
upslogx(LOG_WARNING,
695689
"%s: Device detached? (error %d: %s)",
696690
msg, res, nut_usb_strerror(res));
697691

698-
upslogx(LOG_NOTICE, "Reconnect attempt #%d", ++try_num);
699692
hd = NULL;
700693
reconnect_ups();
701694

702695
if(hd) {
703696
upslogx(LOG_NOTICE, "Successfully reconnected");
704-
try_num = 0;
705697
reconnect_trying(RECONNECT_UPDATEINFO);
706698
upsdrv_initinfo();
707699
reconnect_trying(RECONNECT_SUCCESS);
708-
} else {
709-
if(try_num > MAX_RECONNECT_TRIES) {
710-
fatalx(EXIT_FAILURE, "Too many unsuccessful reconnection attempts");
711-
}
712700
}
713701
break;
714702
}

0 commit comments

Comments
 (0)