Revision: 14897
Author: adrian.chadd
Date: Sun Jul 10 06:13:32 2011
Log: Fix timeout handling
http://code.google.com/p/lusca-cache/source/detail?r=14897
Modified:
/playpen/LUSCA_HEAD_ipv6/src/forward.c
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/forward.c Sat Jul 9 19:10:58 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/forward.c Sun Jul 10 06:13:32 2011
@@ -347,6 +347,12 @@
/* And whilst we're at it, populate out_ip6 */
sqinet_copy(&fwdState->request->out_ip6,
&fd_table[server_fd].local_address);
}
+
+ /* Timeout? */
+ if (status == COMM_TIMEOUT) {
+ fwdConnectTimeout(server_fd, data);
+ return;
+ }
if (Config.onoff.log_ip_on_direct && status != COMM_ERR_DNS &&
fs->code == HIER_DIRECT)
hierarchyNote(&fwdState->request->hier, fs->code,
fd_table[server_fd].ipaddrstr);
@@ -398,7 +404,6 @@
FwdServer *fs = fwdState->servers;
ErrorState *err;
debug(17, 2) ("fwdConnectTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
- assert(fd == fwdState->server_fd);
if (Config.onoff.log_ip_on_direct && fs->code == HIER_DIRECT &&
fd_table[fd].ipaddrstr[0])
hierarchyNote(&fwdState->request->hier, fs->code,
fd_table[fd].ipaddrstr);
if (entry->mem_obj->inmem_hi == 0) {
@@ -412,7 +417,8 @@
if (fwdState->servers->peer)
peerConnectFailed(fwdState->servers->peer);
}
- comm_close(fd);
+ if (fd != -1)
+ comm_close(fd);
}
typedef struct {
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.