cvs: php4 /main network.c php_network.h
| From: | Stig Venaas | Date: | Sun, 03 Sep 2000 19:12:29 +0000 |
| Subject: | cvs: php4 /main network.c php_network.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1527@lists.php.net to get a copy of this message | ||
venaas Sun Sep 3 12:12:29 2000 EDT
Modified files:
/php4/main network.c php_network.h
Log:
Added timeout argument, but not used yet
Index: php4/main/network.c
diff -u php4/main/network.c:1.1 php4/main/network.c:1.2
--- php4/main/network.c:1.1 Sun Sep 3 02:30:41 2000
+++ php4/main/network.c Sun Sep 3 12:12:28 2000
@@ -15,7 +15,7 @@
| Authors: Stig Venaas <venaas@uninett.no> |
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.1 2000/09/03 09:30:41 venaas Exp $ */
+/* $Id: network.c,v 1.2 2000/09/03 19:12:28 venaas Exp $ */
#ifdef PHP_WIN32
#include <windows.h>
@@ -58,7 +58,7 @@
/*
* Converts a host name to an IP address.
*/
-static int my_lookup_hostname(const char *addr, struct in_addr *in)
+static int php_network_lookup_hostname(const char *addr, struct in_addr *in)
{
struct hostent *host_info;
@@ -77,13 +77,14 @@
/*
* Creates a socket of type socktype and connects to the given host and
* port, returns the created socket on success, else returns -1.
+ * timeout gives timeout in seconds, 0 means blocking mode.
*/
-int hostconnect(char *host, int port, int socktype)
+int hostconnect(char *host, int port, int socktype, int timeout)
{
int s;
struct sockaddr_in sa;
- if (my_lookup_hostname(host, &sa.sin_addr))
+ if (php_network_lookup_hostname(host, &sa.sin_addr))
return -1;
s = socket(PF_INET, socktype, 0);
if (s == SOCK_ERR)
Index: php4/main/php_network.h
diff -u php4/main/php_network.h:1.1 php4/main/php_network.h:1.2
--- php4/main/php_network.h:1.1 Sun Sep 3 02:33:14 2000
+++ php4/main/php_network.h Sun Sep 3 12:12:28 2000
@@ -15,9 +15,9 @@
| Authors: Stig Venaas <venaas@uninett.no> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_network.h,v 1.1 2000/09/03 09:33:14 venaas Exp $ */
+/* $Id: php_network.h,v 1.2 2000/09/03 19:12:28 venaas Exp $ */
-int hostconnect(char *host, int port, int socktype);
+int hostconnect(char *host, int port, int socktype, int timeout);
/*
* Local variables: