Skip to content

Instantly share code, notes, and snippets.

@CuberL
Created April 22, 2020 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CuberL/250e3687875376985bde9cfb013e922f to your computer and use it in GitHub Desktop.
Save CuberL/250e3687875376985bde9cfb013e922f to your computer and use it in GitHub Desktop.
problem in tbox http client
#include "tbox/tbox.h"
int main() {
tb_init(tb_null, tb_null);
int i = 10;
while (i --> 1) {
tb_http_ref_t http = tb_http_init();
tb_http_ctrl(http, TB_HTTP_OPTION_SET_COOKIES, tb_cookies());
tb_http_ctrl(http, TB_HTTP_OPTION_SET_METHOD, TB_HTTP_METHOD_GET);
tb_http_ctrl(http, TB_HTTP_OPTION_SET_URL, "http://google.com");
if (!tb_http_open(http)) {
return -1;
}
tb_http_status_t *status = tb_http_status(http);
tb_http_exit(http);
tb_http_close(http);
}
tb_sleep(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment