Merge pull request #114 from moteus/master
Add. __tostring metamethod to http post.
This commit is contained in:
commit
14a9246abe
@ -569,6 +569,7 @@ static const struct luaL_Reg lcurl_hpost_methods[] = {
|
||||
{"get", lcurl_hpost_get },
|
||||
{"free", lcurl_hpost_free },
|
||||
{"__gc", lcurl_hpost_free },
|
||||
{"__tostring", lcurl_hpost_to_s },
|
||||
|
||||
{NULL,NULL}
|
||||
};
|
||||
|
@ -187,6 +187,12 @@ static const char* LCURL_USERVAL = "LCURL Uservalues";
|
||||
|
||||
static int luaopen_lcurl_(lua_State *L, const struct luaL_Reg *func){
|
||||
if(!LCURL_INIT){
|
||||
/* Note from libcurl documentation.
|
||||
*
|
||||
* The environment it sets up is constant for the life of the program
|
||||
* and is the same for every program, so multiple calls have the same
|
||||
* effect as one call. ... This function is not thread safe.
|
||||
*/
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
LCURL_INIT = 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user