lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH 2.8.5-pre4] gethost...


From: Ilya Zakharevich
Subject: lynx-dev [PATCH 2.8.5-pre4] gethost...
Date: Mon, 2 Feb 2004 22:46:16 -0800
User-agent: Mutt/1.4i

This patch falls back to the "normal" behaviour if fork() fails.

Enjoy,
Ilya

--- ./WWW/Library/Implementation/HTTCP.c-pre    Sat Jan 24 17:51:04 2004
+++ ./WWW/Library/Implementation/HTTCP.c        Mon Feb  2 22:43:30 2004
@@ -912,6 +913,23 @@ PUBLIC struct hostent * LYGetHostByName 
 
        if (fpid < 0) {     /* fork failed */
                close(pfd[0]);
+
+               /* Retry the usual way */
+               {
+                   struct hostent  *phost;
+                   phost = gethostbyname(host);        /* See netdb.h */
+#ifdef MVS
+                   CTRACE((tfp, "LYGetHostByName: gethostbyname() returned 
%d\n", phost));
+#endif /* MVS */
+                   if (phost) {
+                       lynx_nsl_status = HT_OK;
+                       result_phost = phost;
+                       goto done;
+                   } else {
+                       lynx_nsl_status = HT_H_ERRNO_VALID;
+                       goto failed;
+                   }
+               }
                goto failed;
        }
 
@@ -1154,6 +1172,7 @@ PUBLIC struct hostent * LYGetHostByName 
 #endif /* !NSL_FORK, !_WINDOWS_NSL */
 #endif /* !NSL_FORK */
 
+  done:
 #ifdef DEBUG_HOSTENT
     dump_hostent("End of LYGetHostByName", result_phost);
     CTRACE((tfp, "LYGetHostByName: Resolved name to a hostent.\n"));

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]