]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9457: fix code after decl error
authorMike Jerris <mike@jerris.com>
Wed, 7 Sep 2016 14:27:03 +0000 (10:27 -0400)
committerMike Jerris <mike@jerris.com>
Wed, 7 Sep 2016 14:27:03 +0000 (10:27 -0400)
src/mod/applications/mod_http_cache/mod_http_cache.c

index 2f838b29d1714c41b8db869e362e62bdb33ee5ba..62801790fc6469b34db2bdfc596edd52ab3889fb 100644 (file)
@@ -323,6 +323,7 @@ static switch_status_t http_put(url_cache_t *cache, http_profile_t *profile, swi
 
        while (sent_bytes < file_info.st_size) {
                switch_size_t content_length = file_info.st_size - sent_bytes < bytes_per_block ? file_info.st_size - sent_bytes : bytes_per_block;
+               block_info_t block_info = { file_to_put, content_length };
                // make a copy of the URL so we can add the query string to ir
                char *query_string = NULL;
                char *full_url = NULL;
@@ -360,7 +361,6 @@ static switch_status_t http_put(url_cache_t *cache, http_profile_t *profile, swi
 
                /* we want to use our own read function so we can send a portion of the file */ 
                switch_curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback);
-               block_info_t block_info = { file_to_put, content_length };
                switch_curl_easy_setopt(curl_handle, CURLOPT_READDATA, &block_info);
 
                switch_curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE_LARGE, content_length);