summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-06-05 16:29:43 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-06-05 16:29:43 +0000
commit564df93fc94175ed2048fb50ba0c898ef7552bf8 (patch)
treeab2454740d8b3048be29f07021712df67bc78220 /src
parent17d4ac10c636592881519d18622ecbf969ddfd05 (diff)
Fixed broken build without OpenSSL
Fixed fale off-by-one for read timeout
Diffstat (limited to 'src')
-rw-r--r--src/htsback.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/htsback.c b/src/htsback.c
index 79c3bca..a51a1cf 100644
--- a/src/htsback.c
+++ b/src/htsback.c
@@ -2500,6 +2500,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
// vérification de sécurité
if (back[i].r.soc != INVALID_SOCKET) { // hey, you never know..
// Do not endlessly wait when receiving SSL http data (Patrick Pfeifer)
+#if HTS_USEOPENSSL
if (!(back[i].r.ssl && back[i].status > 0 && back[i].status < 1000)) {
do_wait = 1;
@@ -2521,6 +2522,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
nfds = back[i].r.soc;
}
}
+#endif
} else {
back[i].r.statuscode = STATUSCODE_CONNERROR;
if (back[i].status == STATUS_CONNECTING)
@@ -2831,8 +2833,10 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
//## if (back[i].url_adr[0]!=lOCAL_CHAR)
if (back[i].r.is_file)
dispo = 1;
+#if HTS_USEOPENSSL
else if (back[i].r.ssl)
dispo = 1;
+#endif
else
dispo = FD_ISSET(back[i].r.soc, &fds);
@@ -3955,7 +3959,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
if (back[i].status > 0) { // réception/connexion/..
if (back[i].timeout > 0) {
//printf("time check %d\n",((int) (act-back[i].timeout_refresh))-back[i].timeout);
- if (((int) (act - back[i].timeout_refresh)) + 1 >= back[i].timeout) {
+ if (((int) (act - back[i].timeout_refresh)) >= back[i].timeout) {
hts_log_print(opt, LOG_DEBUG, "connection timed out for %s%s", back[i].url_adr,
back[i].url_fil);
if (back[i].r.soc != INVALID_SOCKET) {