GithubHelp home page GithubHelp logo

Comments (9)

huiguangjun avatar huiguangjun commented on August 18, 2024

麻烦设置一下这个日志开关,然后复现一下问题,终端上会刷一些请求日志,麻烦把这个日志贴一下。
在windows下
set OSS_SDK_LOG_LEVEL=debug
在 linux 环境下
export OSS_SDK_LOG_LEVEL=debug

from aliyun-oss-cpp-sdk.

ayumukid avatar ayumukid commented on August 18, 2024

我设置了日志级别,但日志的默认路径不知道在哪,通过控制台打印的错误码 是 200028,msg timeout was reached
上个代码:

std::string AccessKeyId = "xxxx";
std::string AccessKeySecret = "xxxx"
std::string Endpoint = "oss-cn-hangzhou.aliyuncs.com";
std::string BucketName = "aaa";
std::string ObjectName = "data\2.jpg";



InitializeSdk();
SetLogLevel(LogDebug);



ClientConfiguration conf;
OssClient client(Endpoint, AccessKeyId, AccessKeySecret, conf);


auto outcome = client.PutObject(BucketName, ObjectName, "d:\\3.jpg"); //这里填写本地的文件名


if (!outcome.isSuccess()) {
	/* 异常处理 */
	std::cout << "PutObject fail" <<
		",code:" << outcome.error().Code() <<
		",message:" << outcome.error().Message() <<
		",requestId:" << outcome.error().RequestId() << std::endl;
	ShutdownSdk();
	return -1;
}
else
{
	std::cout << "succ";
}


ShutdownSdk();

from aliyun-oss-cpp-sdk.

huiguangjun avatar huiguangjun commented on August 18, 2024

日志是默认输出 到std::cerr 上。

from aliyun-oss-cpp-sdk.

huiguangjun avatar huiguangjun commented on August 18, 2024

7.66 版本是你自己编译出来的吗, 是不是你编译的方式有问题, 导致它无法正常运行。

你可以使用 附带的curl 程序 来验证你的构建的libcurl 库

from aliyun-oss-cpp-sdk.

ayumukid avatar ayumukid commented on August 18, 2024

libcurl 是 v7.67,是自己编译的,它依赖openssl v1.1.1d版本的,自带的libcurl 是7.59版本的,是正常的。

我自己有写过简单的demo 验证过libcurl v7.67版本的http 的post get,put请求是正常的
我个人觉得是openssl 1.1.1d和openssl 1.0.x 版本头文件变更导致的兼容性问题
建议你可以自行编译个libcurl7.67版本验证一下看看

from aliyun-oss-cpp-sdk.

huiguangjun avatar huiguangjun commented on August 18, 2024

在工程下,有个 third_party/ 目录, 你可以把 自己编译 相关 库 和 头文件一起更新替换掉。

然后再重新构建。

from aliyun-oss-cpp-sdk.

ayumukid avatar ayumukid commented on August 18, 2024

我就是这么操作的,编译出来的

from aliyun-oss-cpp-sdk.

huiguangjun avatar huiguangjun commented on August 18, 2024

1)本地做了测试,替换到 libcurl 7.6.7 版本,是可以正常 work的。
2)在windows 下,libcurl 默认是 使用 WINSSL, 你不需要特别构建 openssl v1.1.1d, 你可以使用缺省命令来构建出 libcurl,然后再试试。

from aliyun-oss-cpp-sdk.

ayumukid avatar ayumukid commented on August 18, 2024

后面重新试了一下,是可以通过put上传图片文件成功了

from aliyun-oss-cpp-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.