summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-04-22 16:40:20 +0200
committerSimon Rettberg2024-05-13 18:26:42 +0200
commit6a2e1c980402cde16315fe91ff8d54ac852de8c5 (patch)
tree622daa12166e32a24edb893f5d10f6860eb3b2e1
parent[FUSE] Rename version -> revision in /create (diff)
downloaddnbd3-6a2e1c980402cde16315fe91ff8d54ac852de8c5.tar.gz
dnbd3-6a2e1c980402cde16315fe91ff8d54ac852de8c5.tar.xz
dnbd3-6a2e1c980402cde16315fe91ff8d54ac852de8c5.zip
[FUSE] Move curl reset to start of function
-rw-r--r--src/fuse/cowfile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fuse/cowfile.c b/src/fuse/cowfile.c
index 67f3eab..380b474 100644
--- a/src/fuse/cowfile.c
+++ b/src/fuse/cowfile.c
@@ -199,6 +199,7 @@ static bool createSession( const char *imageName, uint16_t rid )
char body[1000], reply[500];
const char *nameEsc;
+ curl_easy_reset( curl );
snprintf( url, COW_URL_STRING_SIZE, COW_API_CREATE, cowServerAddress );
logadd( LOG_INFO, "COW_API_CREATE URL: %s", url );
curl_easy_setopt( curl, CURLOPT_POST, 1L );
@@ -239,7 +240,6 @@ static bool createSession( const char *imageName, uint16_t rid )
return false;
}
strncpy( metadata->uuid, reply, sizeof(metadata->uuid) );
- curl_easy_reset( curl );
logadd( LOG_DEBUG1, "Cow session started, uuid: %s", metadata->uuid );
return true;
}
@@ -324,7 +324,6 @@ static bool postMergeRequest()
char *uuid;
curl_easy_reset( curl );
-
snprintf( url, COW_URL_STRING_SIZE, COW_API_START_MERGE, cowServerAddress );
curl_easy_setopt( curl, CURLOPT_URL, url );
curl_easy_setopt( curl, CURLOPT_POST, 1L );