libidav/session.c

changeset 851
55c5d36b82b7
parent 828
e082e5d7d75b
--- a/libidav/session.c	Thu Nov 28 17:53:13 2024 +0100
+++ b/libidav/session.c	Thu Dec 12 16:46:43 2024 +0100
@@ -211,7 +211,21 @@
             char *log_method;
             char *log_url;
             curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_URL, &log_url);
+#if LIBCURL_VERSION_NUM >= 0x074800
             curl_easy_getinfo(sn->handle, CURLINFO_EFFECTIVE_METHOD , &log_method);
+#else
+            long opt_upload = 0;
+            curl_easy_getinfo(sn->handle, CURLOPT_UPLOAD, &opt_upload);
+            char *opt_custom = NULL;
+            curl_easy_getinfo(sn->handle, CURLOPT_CUSTOMREQUEST, &opt_custom);
+            if(opt_custom) {
+                log_method = opt_custom;
+            } else if(opt_upload) {
+                log_method = "PUT";
+            } else {
+                log_method = "GET";
+            }
+#endif
             char *log_reqbody = NULL;
             size_t log_reqbodylen = 0;
             char *log_rpbody = NULL;

mercurial