提交 93ba268f 编写于 作者: W WangFengTu 提交者: lifeng68

fix panic when pull busybox

curl_global_init need inited to CURL_GLOBAL_ALL to support ssl
Signed-off-by: NWangFengTu <wangfengtu@huawei.com>
上级 5992ba2e
......@@ -59,7 +59,7 @@
#include "containers_gc.h"
#include "plugin.h"
#include "selinux_label.h"
#include "http.h"
#ifdef ENABLE_OCI_IMAGE
#include "driver.h"
......@@ -1481,6 +1481,8 @@ int main(int argc, char **argv)
exit(ECOMMON);
}
http_global_init();
set_mallopt();
update_isulad_rlimits();
......
......@@ -33,7 +33,7 @@ size_t util_base64_encode(unsigned char *bytes, size_t len, char *out, size_t ou
BUF_MEM *pmem = NULL;
if (bytes == NULL || len == 0 || out == NULL || out_len < util_base64_encode_len(len)) {
ERROR("Invalid param for encoding base64, input length %d, out length %d", len, out_len);
ERROR("Invalid param for encoding base64, input length %zu, out length %zu", len, out_len);
return -1;
}
......@@ -67,7 +67,7 @@ size_t util_base64_encode(unsigned char *bytes, size_t len, char *out, size_t ou
(void)BIO_get_mem_ptr(io, &pmem);
if (pmem->length > out_len) {
ERROR("result length larger than output length, result length %d, input length %d, output length %d",
ERROR("result length larger than output length, result length %zu, input length %zu, output length %zu",
pmem->length, len, out_len);
ret = -1;
goto out;
......@@ -128,8 +128,8 @@ size_t util_base64_decode(char *input, size_t len, unsigned char *out, size_t ou
size_t size = 0;
if (input == NULL || result_len < 0 || out == 0 || result_len > out_len) {
ERROR("Invalid param for base64 decode, input length %d, result length %d, output length %d",
result_len, out_len);
ERROR("Invalid param for base64 decode, input length %zu, result length %zu, output length %zu",
len, result_len, out_len);
return -1;
}
......@@ -147,7 +147,7 @@ size_t util_base64_decode(char *input, size_t len, unsigned char *out, size_t ou
size = BIO_read(io, out, out_len);
if (size != result_len) {
ERROR("base64 decode failed, actual length not match calculated length, expected %d, got %d",
ERROR("base64 decode failed, actual length not match calculated length, expected %zu, got %zu",
result_len, size);
}
......
......@@ -78,7 +78,7 @@ void free_http_get_options(struct http_get_options *options)
void http_global_init(void)
{
curl_global_init(CURL_GLOBAL_NOTHING);
curl_global_init(CURL_GLOBAL_ALL);
}
void http_global_cleanup(void)
......@@ -316,7 +316,7 @@ int http_request(const char *url, struct http_get_options *options, long *respon
ERROR("reach the max redirect num");
return -1;
}
http_global_init();
/* init the curl session */
curl_handle = curl_easy_init();
if (curl_handle == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册