mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
firstcontact: add a 10s connect timeout
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
@@ -20,6 +21,8 @@ int main(int argc, char **argv)
|
|||||||
char *devid = NULL;
|
char *devid = NULL;
|
||||||
char *url;
|
char *url;
|
||||||
|
|
||||||
|
alarm(15);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option = getopt(argc, argv, "k:c:o:hi:");
|
int option = getopt(argc, argv, "k:c:o:hi:");
|
||||||
|
|
||||||
@@ -85,6 +88,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
|
curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
|
||||||
curl_easy_setopt(curl, CURLOPT_SSLKEY, file_key);
|
curl_easy_setopt(curl, CURLOPT_SSLKEY, file_key);
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10L);
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
if (res != CURLE_OK)
|
if (res != CURLE_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user