在奇怪的情况下,SSL连接错误/崩溃

发布于 2025-02-10 15:05:24 字数 899 浏览 0 评论 0原文

当在共享对象中使用libquickmail时,该应用程序从此加载时会崩溃。

假设我有两个程序:

程序1是一个加载共享对象的程序。我们将此程序称为“ Prog1”和共享对象“ SO1”。如果相关,则整个过程是C ++乌鸦框架(多线程)应用程序。

程序2只是一个文件主函数。我们将其称为“ Prog2”。

SO1和Prog2都使用文档中指定的相同的libquickmail代码,特别是该代码:

quickmail_initialize();
quickmail mailobj = quickmail_create("[SENDER_EMAIL]","libquickmail test e-mail");
quickmail_set_body(mailobj, "This is a test e-mail.\nThis mail was sent using libquickmail.");
quickmail_add_to(mailobj, "[RECEIVER_EMAIL]");


const char *errmsg = quickmail_send(mailobj, "[SMPT_ADDRESS]", [SMTP_PORT], "[SENDER_EMAIL]", "[PASSWORD]");
if (errmsg != NULL) {
    fprintf(stderr, "Error sending e-mail: %s\n", errmsg);
}

quickmail_destroy(mailobj);

Prog2运行良好,但是当Prog1试图运行加载的SO1时,它会崩溃或抛出SSL连接错误。但是,当我将代码直接移动到prog1时,这不会发生,但是这不是一个可行的解决方案。

关于为什么会发生的任何建议/原因?

感谢您的阅读

When using libQuickMail in the shared object, the application crashes when loading from that so.

Say I have two programs:

program 1 is a program that loads a shared object. We'll call this program "prog1" and the shared object "so1". If relevant, the whole thing is a C++ Crow framework (multithreaded) application.

program 2 is just a single file main function. We'll call this "prog2".

Both so1 and prog2 use the same libquickmail code specified in the docs, specifically this one:

quickmail_initialize();
quickmail mailobj = quickmail_create("[SENDER_EMAIL]","libquickmail test e-mail");
quickmail_set_body(mailobj, "This is a test e-mail.\nThis mail was sent using libquickmail.");
quickmail_add_to(mailobj, "[RECEIVER_EMAIL]");


const char *errmsg = quickmail_send(mailobj, "[SMPT_ADDRESS]", [SMTP_PORT], "[SENDER_EMAIL]", "[PASSWORD]");
if (errmsg != NULL) {
    fprintf(stderr, "Error sending e-mail: %s\n", errmsg);
}

quickmail_destroy(mailobj);

prog2 runs just fine, however when prog1 tries to run the loaded so1, it either crashes or throws an SSL connect error. This doesn't happen when I move the code directly to prog1, though, however that isn't a viable solution.

Any suggestions/reasons as to why this would happen?

Thanks for reading

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文