From: Bastian Dehn Date: Sun, 21 Jan 2024 14:07:20 +0000 (+0100) Subject: fix get response code X-Git-Tag: v1.0.0^2~492 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=9db44a41084d6b05eadcbf54ebdfbaebd82f6e00;p=sane-kds-s2000w-net.git fix get response code --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index eb6bec4..bc6bafc 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -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)