hyanantha               Wed Sep 11 06:28:23 2002 EDT

  Modified files:              
    /php4/ext/ftp       ftp.c 
  Log:
  Removed unnecessary code that was added for NetWare
  
  
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.61 php4/ext/ftp/ftp.c:1.62
--- php4/ext/ftp/ftp.c:1.61     Thu Sep  5 06:13:27 2002
+++ php4/ext/ftp/ftp.c  Wed Sep 11 06:28:22 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ftp.c,v 1.61 2002/09/05 10:13:27 hyanantha Exp $ */
+/* $Id: ftp.c,v 1.62 2002/09/11 10:28:22 hyanantha Exp $ */
 
 #include "php.h"
 
@@ -46,11 +46,6 @@
 #include <sys/socket.h>
 #endif
 #endif
-
-/* Below stuff to introduce delay so that sockets are freed */
-#define THREAD_SWITCH_DELAY         1000
-#define THREAD_SWITCH_WITH_DELAY    NXThreadDelay(THREAD_SWITCH_DELAY)
-
 #else
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -147,11 +142,7 @@
 
        size = sizeof(ftp->localaddr);
        memset(&ftp->localaddr, 0, size);
-#if defined(NETWARE) && !defined(USE_WINSOCK)
        if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, (unsigned 
int*)&size) == -1) {
-#else
-       if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) {
-#endif
                perror("getsockname");
                goto bail;
        }
@@ -235,29 +226,14 @@
        if (!ftp_getresp(ftp))
                return 0;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_login: response = %d\n", ftp->resp);
-#endif
-
        if (ftp->resp == 230)
                return 1;
        if (ftp->resp != 331)
                return 0;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_login: sending password...\n");
-#endif
-
        if (!ftp_putcmd(ftp, "PASS", pass))
                return 0;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_login: getting response...\n");
-#endif
-
        if (!ftp_getresp(ftp))
                return 0;
        return (ftp->resp == 230);
@@ -872,11 +848,6 @@
        int             size;
        char            *data;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_putcmd: building output buffer...\n");
-#endif
-
        /* build the output buffer */
        if (args && args[0]) {
                /* "cmd args\r\n\0" */
@@ -893,11 +864,6 @@
 
        data = ftp->outbuf;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_putcmd: sending data...\n");
-#endif
-
        if (my_send(ftp, ftp->fd, data, size) != size)
                return 0;
 
@@ -946,11 +912,6 @@
                        }
                }
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-        /*THREAD_SWITCH_WITH_DELAY;*/
-        printf ("PHP | ftp_readline: receiving data...\n");
-#endif
-
                data = eol;
                if ((rcvd = my_recv(ftp, ftp->fd, data, size)) < 1) {
                        return 0;
@@ -972,11 +933,6 @@
        buf = ftp->inbuf;
        ftp->resp = 0;
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_getresp: getting response...\n");
-#endif
-
        while (1) {
 
                if (!ftp_readline(ftp)) {
@@ -1004,11 +960,6 @@
                        10 * (ftp->inbuf[1] - '0') +
                        (ftp->inbuf[2] - '0');
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | ftp_getresp: response = %c%c%c\n", ftp->inbuf[0], ftp->inbuf[1], 
ftp->inbuf[2]);
-#endif
-
        memmove(ftp->inbuf, ftp->inbuf + 4, FTP_BUFSIZE - 4);
 
        if (ftp->extra)
@@ -1035,25 +986,10 @@
                FD_ZERO(&write_set);
                FD_SET(s, &write_set);
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-        /*THREAD_SWITCH_WITH_DELAY;*/
-        printf ("PHP | my_send: calling select()...\n");
-#endif
-
                n = select(s + 1, NULL, &write_set, NULL, &tv);
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-        /*THREAD_SWITCH_WITH_DELAY;*/
-        printf ("PHP | my_send: select() returned %d\n", n);
-#endif
-
                if (n < 1) {
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-        /*THREAD_SWITCH_WITH_DELAY;*/
-        printf ("PHP | my_send: error = %d\n", errno);
-#endif
 
-/*#ifndef PHP_WIN32*/
 #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
                        if (n == 0)
                                errno = ETIMEDOUT;
@@ -1061,11 +997,6 @@
                        return -1;
                }
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-        /*THREAD_SWITCH_WITH_DELAY;*/
-        printf ("PHP | my_send: FTP request **%s**\n", buf);
-#endif
-
                sent = send(s, buf, size, 0);
                if (sent == -1)
                        return -1;
@@ -1093,14 +1024,8 @@
        FD_ZERO(&read_set);
        FD_SET(s, &read_set);
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | my_recv: calling select()...\n");
-#endif
-
        n = select(s + 1, &read_set, NULL, NULL, &tv);
        if (n < 1) {
-/*#ifndef PHP_WIN32*/
 #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
                if (n == 0)
                        errno = ETIMEDOUT;
@@ -1128,7 +1053,6 @@
        FD_SET(s, &read_set);
        n = select(s + 1, &read_set, NULL, NULL, &tv);
        if (n < 1) {
-/*#ifndef PHP_WIN32*/
 #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
                if (n == 0)
                        errno = ETIMEDOUT;
@@ -1180,14 +1104,8 @@
        FD_ZERO(&accept_set);
        FD_SET(s, &accept_set);
 
-#if defined(NETWARE) && defined(USE_WINSOCK)    /* Atleast for now, to allow sockets 
to be freed */
-    /*THREAD_SWITCH_WITH_DELAY;*/
-    printf ("PHP | FTP: calling select()...\n");
-#endif
-
        n = select(s + 1, &accept_set, NULL, NULL, &tv);
        if (n < 1) {
-/*#ifndef PHP_WIN32*/
 #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
                if (n == 0)
                        errno = ETIMEDOUT;
@@ -1195,11 +1113,7 @@
                return -1;
        }
 
-#if defined(NETWARE) && !defined(USE_WINSOCK)
        return accept(s, addr, (unsigned int*)addrlen);
-#else
-       return accept(s, addr, addrlen);
-#endif
 }
 /* }}} */
 
@@ -1271,11 +1185,7 @@
                goto bail;
        }
 
-#if defined(NETWARE) && !defined(USE_WINSOCK)
        if (getsockname(fd, (struct sockaddr*) &addr, (unsigned int*)&size) == -1) {
-#else
-       if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) {
-#endif
                perror("getsockname");
                goto bail;
        }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to