added specifier to control the API version that is called and set it to curent stable (which is version 1.2)

This commit is contained in:
root
2014-12-26 20:28:23 -06:00
parent 397063b026
commit a59ff6f516
2 changed files with 10 additions and 4 deletions

View File

@@ -33,6 +33,8 @@
#define MFAPI_MAX_LEN_KEY 15 #define MFAPI_MAX_LEN_KEY 15
#define MFAPI_MAX_LEN_NAME 255 #define MFAPI_MAX_LEN_NAME 255
#define MFAPI_VERSION "1.2"
enum mfconn_device_change_type { enum mfconn_device_change_type {
MFCONN_DEVICE_CHANGE_DELETED_FOLDER, MFCONN_DEVICE_CHANGE_DELETED_FOLDER,
MFCONN_DEVICE_CHANGE_DELETED_FILE, MFCONN_DEVICE_CHANGE_DELETED_FILE,

View File

@@ -263,8 +263,10 @@ const char *mfconn_create_unsigned_get(mfconn * conn, int ssl,
return NULL; return NULL;
} }
api_request = strdup_printf("%s//%s/api/%s", api_request = strdup_printf("%s//%s/api/%s/%s",
(ssl ? "https:" : "http:"), conn->server, api); (ssl ? "https:" : "http:"),
conn->server,
MFAPI_VERSION, api);
// compute the amount of space requred to realloc() the request // compute the amount of space requred to realloc() the request
bytes_to_alloc = api_args_len; bytes_to_alloc = api_args_len;
@@ -351,8 +353,10 @@ const char *mfconn_create_signed_get(mfconn * conn, int ssl,
return NULL; return NULL;
} }
api_request = strdup_printf("%s//%s/api/%s", api_request = strdup_printf("%s//%s/api/%s/%s",
(ssl ? "https:" : "http:"), conn->server, api); (ssl ? "https:" : "http:"),
conn->server,
MFAPI_VERSION, api);
call_hash = mfconn_create_call_signature(conn, api_request, api_args); call_hash = mfconn_create_call_signature(conn, api_request, api_args);
signature = strdup_printf("&signature=%s", call_hash); signature = strdup_printf("&signature=%s", call_hash);