]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix get response code
authorBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 14:07:20 +0000 (15:07 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 14:07:20 +0000 (15:07 +0100)
src/kds_s2000w_handler.c

index eb6bec416e18de3da394794e5ee788e661513069..bc6bafc0194abe7ef29722c0f0d7fdcea933ddb7 100644 (file)
@@ -42,8 +42,8 @@ device_state kds_s2000w_handler_open()
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"OCPUserName\":\"hhaalo\"}");
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) &resp);
-       curl_easy_setopt(curl, CURLINFO_RESPONSE_CODE, &resp.code);
        CURLcode result = curl_easy_perform(curl);
+       curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp.code);
 
        json_object* resObj = NULL;
        if (result != CURLE_OK || resp.code == 404)