Skip to content

Commit

Permalink
added connection and read/write timeouts to netsvc post
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Nov 16, 2021
1 parent bf59cf5 commit 7552259
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/netsvc/netsvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ int netsvc_post (lua_State* L)
{
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10L); // seconds
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L); // seconds
curl_easy_setopt(curl, CURLOPT_READFUNCTION, netsvc_read_data);
curl_easy_setopt(curl, CURLOPT_READDATA, &rqst);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)rqst.size);
Expand Down

0 comments on commit 7552259

Please sign in to comment.