]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix wake up response
authorBastian Dehn <hhaalo@arcor.de>
Sat, 4 Jan 2025 10:58:40 +0000 (11:58 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 4 Jan 2025 10:58:40 +0000 (11:58 +0100)
src/kds_s2000w_handler.c

index f6cf7ecd827920ee56bc2bbc964005f479d9331a..86fc6206a475cdc6bca0c32c26a31e642623b4f2 100644 (file)
@@ -282,9 +282,12 @@ void kds_s2000w_handler_open(const char* devicename, void** handle)
 
        kds_s2000w_client_init();
 
-       response* resp = kds_s2000w_client_response_init();
+       response* resp = NULL;
        int result = 0;
        for (int i = 0; i < 30; i++) {
+               kds_s2000w_client_response_free(resp);
+               resp = NULL;
+               resp = kds_s2000w_client_response_init();
                result = kds_s2000w_client_open_session(resp);
 
                if (result != 0) {
@@ -302,8 +305,6 @@ void kds_s2000w_handler_open(const char* devicename, void** handle)
                        break;
                }
 
-               kds_s2000w_client_response_free(resp);
-               resp = NULL;
                sleep(1);
        }