diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-09-22 22:13:21 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-09-22 22:13:21 +0000 |
commit | 7cf5915ead7c80b3011a37eaade214568d938f5b (patch) | |
tree | 54222dc1e2b1c447232301c6441769d2364f08b6 /cups/http-addrlist.c | |
parent | 030ae6a14e49fda8ca30a2c0e065600c3984081a (diff) | |
download | cups-7cf5915ead7c80b3011a37eaade214568d938f5b.tar.gz |
Merge changes from CUPS 1.5svn-r9313.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2683 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/http-addrlist.c')
-rw-r--r-- | cups/http-addrlist.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index ddf8079b4..14406427d 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -102,6 +102,16 @@ httpAddrConnect( setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val)); #endif /* SO_NOSIGPIPE */ +#ifdef __APPLE__ + /* + * Use a 30-second read timeout when connecting to limit the amount of time + * we block... + */ + + val = 30; + setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(val)); +#endif /* __APPLE__ */ + /* * Using TCP_NODELAY improves responsiveness, especially on systems * with a slow loopback interface... @@ -154,6 +164,9 @@ httpAddrConnect( addrlist = addrlist->next; } + if (!addrlist) + _cupsSetError(HTTP_SERVICE_UNAVAILABLE, _("Unable to connect to server"), 1); + return (addrlist); } |