handle->connected = 1;
- if (esl_recv(handle)) {
+ if (esl_recv_timed(handle, timeout)) {
snprintf(handle->err, sizeof(handle->err), "Connection Error");
goto fail;
}
esl_send(handle, sendbuf);
- if (esl_recv(handle)) {
+ if (esl_recv_timed(handle, timeout)) {
snprintf(handle->err, sizeof(handle->err), "Authentication Error");
goto fail;
}
}
esl_mutex_unlock(handle->mutex);
}
+
+ if (ms == -1) {
+ ms = 30000;
+ }
tv.tv_usec = ms * 1000;