GithubHelp home page GithubHelp logo

hisona / https_client Goto Github PK

View Code? Open in Web Editor NEW
120.0 120.0 74.0 2.03 MB

HTTP/HTTPS REST Client C Library

License: Apache License 2.0

CMake 0.58% Makefile 0.95% C 87.77% Tcl 0.01% C++ 2.91% Shell 6.30% Perl 1.48%

https_client's People

Contributors

hisona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

https_client's Issues

problem compile for esp-open rtos

Hi
ok library perfect. su osx system
Compile for Esp-open-rtos problem
error: #error "This module only works on Unix and Windows, see MBEDTLS_TIMING_C in config.h"
#error "This module only works on Unix and Windows, see MBEDTLS_TIMING_C in config.h"

Can't make~

Compiling: main.c ....
gcc -c -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" -O2 -I../mbedtls-2.2.1/include -o main.o main.c
Compiling: https.c ....
gcc -c -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" -O2 -I../mbedtls-2.2.1/include -o https.o https.c
https.c:14:25: 错误:mbedtls/net.h:没有那个文件或目录
https.c:15:29: 错误:mbedtls/entropy.h:没有那个文件或目录
https.c:16:30: 错误:mbedtls/ctr_drbg.h:没有那个文件或目录
https.c:17:27: 错误:mbedtls/error.h:没有那个文件或目录
https.c:18:27: 错误:mbedtls/certs.h:没有那个文件或目录
https.c:47: 错误:expected specifier-qualifier-list before ‘mbedtls_net_context’
https.c: 在函数‘https_init’中:
https.c:461: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:462: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:463: 错误:‘HTTP_INFO’没有名为‘cacert’的成员
https.c:464: 错误:‘HTTP_INFO’没有名为‘ctr_drbg’的成员
https.c:467: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c: 在函数‘https_close’中:
https.c:481: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:484: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:488: 错误:‘HTTP_INFO’没有名为‘cacert’的成员
https.c:489: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:490: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:491: 错误:‘HTTP_INFO’没有名为‘ctr_drbg’的成员
https.c:492: 错误:‘HTTP_INFO’没有名为‘entropy’的成员
https.c: 在文件层:
https.c:504: 错误:expected ‘)’ before ‘*’ token
https.c: 在函数‘https_connect’中:
https.c:620: 错误:‘HTTP_INFO’没有名为‘entropy’的成员
https.c:622: 错误:‘HTTP_INFO’没有名为‘ctr_drbg’的成员
https.c:622: 错误:‘mbedtls_entropy_func’未声明(在此函数内第一次使用)
https.c:622: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
https.c:622: 错误:所在的函数内也只报告一次。)
https.c:622: 错误:‘HTTP_INFO’没有名为‘entropy’的成员
https.c:628: 错误:‘HTTP_INFO’没有名为‘cacert’的成员
https.c:628: 错误:‘mbedtls_test_cas_pem’未声明(在此函数内第一次使用)
https.c:629: 错误:‘mbedtls_test_cas_pem_len’未声明(在此函数内第一次使用)
https.c:635: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:636: 错误:‘MBEDTLS_SSL_IS_CLIENT’未声明(在此函数内第一次使用)
https.c:637: 错误:‘MBEDTLS_SSL_TRANSPORT_STREAM’未声明(在此函数内第一次使用)
https.c:638: 错误:‘MBEDTLS_SSL_PRESET_DEFAULT’未声明(在此函数内第一次使用)
https.c:646: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:646: 错误:‘MBEDTLS_SSL_VERIFY_OPTIONAL’未声明(在此函数内第一次使用)
https.c:647: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:647: 错误:‘HTTP_INFO’没有名为‘cacert’的成员
https.c:648: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:648: 错误:‘mbedtls_ctr_drbg_random’未声明(在此函数内第一次使用)
https.c:648: 错误:‘HTTP_INFO’没有名为‘ctr_drbg’的成员
https.c:649: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:651: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:651: 错误:‘HTTP_INFO’没有名为‘conf’的成员
https.c:657: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:664: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:664: 错误:‘MBEDTLS_NET_PROTO_TCP’未声明(在此函数内第一次使用)
https.c:672: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:672: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:672: 错误:‘mbedtls_net_send’未声明(在此函数内第一次使用)
https.c:672: 错误:‘mbedtls_net_recv’未声明(在此函数内第一次使用)
https.c:672: 错误:‘mbedtls_net_recv_timeout’未声明(在此函数内第一次使用)
https.c:674: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:676: 错误:‘MBEDTLS_ERR_SSL_WANT_READ’未声明(在此函数内第一次使用)
https.c:676: 错误:‘MBEDTLS_ERR_SSL_WANT_WRITE’未声明(在此函数内第一次使用)
https.c: 在函数‘https_write’中:
https.c:694: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:696: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:698: 错误:‘MBEDTLS_ERR_SSL_WANT_WRITE’未声明(在此函数内第一次使用)
https.c: 在函数‘https_read’中:
https.c:714: 错误:‘HTTP_INFO’没有名为‘ssl’的成员
https.c:718: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c: 在函数‘http_get’中:
https.c:759: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:777: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:834: 错误:‘MBEDTLS_ERR_SSL_WANT_READ’未声明(在此函数内第一次使用)
https.c: 在函数‘http_post’中:
https.c:898: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:901: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:918: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:982: 错误:‘MBEDTLS_ERR_SSL_WANT_READ’未声明(在此函数内第一次使用)
https.c: 在函数‘http_open_chunked’中:
https.c:1052: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:1055: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c:1071: 错误:‘HTTP_INFO’没有名为‘ssl_fd’的成员
https.c: 在函数‘http_read_chunked’中:
https.c:1195: 错误:‘MBEDTLS_ERR_SSL_WANT_READ’未声明(在此函数内第一次使用)
make: *** [https.o] 错误 1

Can't make: implicit declaration of function ‘http_write_chunked’

I compile main using:
gcc -o main -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" -O2 -I/usr/include/libnl3/netlink/ -Imbedtls/include main.c ApiService.c libmemd.a mbedtls/library/libmbedx509.a mbedtls/library/libmbedtls.a mbedtls/library/libmbedcrypto.a -lm -lncurses

ApiService.c:17:8: warning: implicit declaration of function ‘http_open_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_open_chunked(&hi2, url) == 0)
^~~~~~~~~~~~~~~~~
http_read_chunked
ApiService.c:21:12: warning: implicit declaration of function ‘http_write_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_write_chunked(&hi2, data, size) != size)
^~~~~~~~~~~~~~~~~~
http_read_chunked
ApiService.c: In function ‘getTask’:
ApiService.c:106:5: warning: format not a string literal and no format arguments [-Wformat-security]
sprintf(data, cJSON_Print(task));
^~~~~~~
https.c: In function ‘mbedtls_net_connect_timeout’:
https.c:496:18: error: ‘errno’ undeclared (first use in this function); did you mean ‘h_errno’?
else if( errno == EINPROGRESS )
^~~~~
h_errno
https.c:496:18: note: each undeclared identifier is reported only once for each function it appears in
https.c:496:27: error: ‘EINPROGRESS’ undeclared (first use in this function)
else if( errno == EINPROGRESS )
^~~~~~~~~~~
https.c:515:33: error: ‘EINTR’ undeclared (first use in this function); did you mean ‘NLE_INTR’?
if(errno == EINTR) continue;
^~~~~
NLE_INTR
Makefile:16: recipe for target 'compile' failed

when I trying to compile test file demo main file (Test a https post with the chunked-encoding data) with: gcc -o main -Imbedtls/include -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" main.c -O2 mbedtls/library/libmbedx509.a mbedtls/library/libmbedtls.a mbedtls/library/libmbedcrypto.a

I got:
main.c: In function ‘main’:
main.c:133:8: warning: implicit declaration of function ‘http_open_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_open_chunked(&hi2, url) == 0)
^~~~~~~~~~~~~~~~~
http_read_chunked
main.c:137:12: warning: implicit declaration of function ‘http_write_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_write_chunked(&hi2, data, size) != size)
^~~~~~~~~~~~~~~~~~
http_read_chunked
/tmp/cc7m6wMn.o: In function main': main.c:(.text.startup+0x3b): undefined reference to http_init'
main.c:(.text.startup+0x48): undefined reference to http_init' main.c:(.text.startup+0x59): undefined reference to http_open_chunked'
main.c:(.text.startup+0x9e): undefined reference to http_write_chunked' main.c:(.text.startup+0xd3): undefined reference to http_write_chunked'
main.c:(.text.startup+0x120): undefined reference to http_write_chunked' main.c:(.text.startup+0x139): undefined reference to http_strerror'
main.c:(.text.startup+0x157): undefined reference to http_close' main.c:(.text.startup+0x15f): undefined reference to http_close'
main.c:(.text.startup+0x19c): undefined reference to `http_read_chunked'
collect2: error: ld returned 1 exit status

main.c

I haven't got compile, but I saw another issue similar and got it!
I'm sorry for the mistake

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.