summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-29 15:32:44 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-29 15:32:44 +0100
commit8c34b57566230ff626806ddecb09297b185e0f3d (patch)
tree63d97b51e8494e1e11a6ef4ea9eae15f3ee8c0b5
parent346bcbcb26fee9c053b7af3ce26165d15b687126 (diff)
owfd: wpa_ctrl: use 10s default timeout
Use a 10s timeout instead of 1s (same as official wpa-ctrl). Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/wpa_ctrl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wpa_ctrl.c b/src/wpa_ctrl.c
index cc2a782..2bf4692 100644
--- a/src/wpa_ctrl.c
+++ b/src/wpa_ctrl.c
@@ -635,8 +635,7 @@ static int wpa_request(int fd, const void *cmd, size_t cmd_len,
{
char buf[REQ_REPLY_MAX];
size_t l = REQ_REPLY_MAX;
-
- int64_t *t, t1 = -1;
+ int64_t *t, t1 = -1, max;
int r;
if (fd < 0)
@@ -651,9 +650,10 @@ static int wpa_request(int fd, const void *cmd, size_t cmd_len,
if (!reply_len)
reply_len = &l;
- /* use a maximum of 1000ms */
- if (*t < 0 || *t > 1000000LL)
- *t = 1000000LL;
+ /* use a maximum of 10s */
+ max = 10LL * 1000LL * 1000LL;
+ if (*t < 0 || *t > max)
+ *t = max;
/* send() with timeout */
r = timed_send(fd, cmd, cmd_len, t);