如何构建自定义libcurl仅支持HTTP / HTTPS协议 [英] how to build customize libcurl to support HTTP / HTTPS protocol only

查看:848
本文介绍了如何构建自定义libcurl仅支持HTTP / HTTPS协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用libcurl只做HTTP / HTTPS请求。我已经下载源代码并构建为静态库。

I am using libcurl only to make HTTP / HTTPS request. I have downloaded the source and built as a static library.

MY最终的可执行文件已经增加了一点。我试图修剪我的可执行文件exe,因为我有其他限制。

MY final executable has increased in size a bit. I am trying to trim down my executable exe as I have other restriction.

在分析过程中,我观察到libcurl是支持许多协议包括HTTP构建的。但是我的具体用途是HTTP / HTTPS。

During analysis i observed the libcurl is built with support for many protocols including HTTP. however my specific use is HTTP/HTTPS.

有没有办法在构建libcurl时定义编译标志以禁用其他协议?

Is there a way where i can define compilation flag to disable other protocols when building libcurl?

感谢您阅读帖子。

推荐答案

看看: http://curl.haxx.se/docs/install.html

    Disabling Specific Protocols in Win32 builds
   --------------------------------------------

   The configure utility, unfortunately, is not available for the Windows
   environment, therefore, you cannot use the various disable-protocol
   options of the configure utility on this platform.

   However, you can use the following defines to disable specific
   protocols:

   HTTP_ONLY             disables all protocols except HTTP
   CURL_DISABLE_FTP      disables FTP
   CURL_DISABLE_LDAP     disables LDAP
   CURL_DISABLE_TELNET   disables TELNET
   CURL_DISABLE_DICT     disables DICT
   CURL_DISABLE_FILE     disables FILE
   CURL_DISABLE_TFTP     disables TFTP
   CURL_DISABLE_HTTP     disables HTTP

   If you want to set any of these defines you have the following
   possibilities:

   - Modify lib/config-win32.h
   - Modify lib/curl_setup.h
   - Modify lib/Makefile.vc6
   - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
     in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.

这篇关于如何构建自定义libcurl仅支持HTTP / HTTPS协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆