Przeglądaj źródła

* Use findanysnum()

Bryan Drewery 15 lat temu
rodzic
commit
943f8a20f8
1 zmienionych plików z 1 dodań i 5 usunięć
  1. 1 5
      src/net.c

+ 1 - 5
src/net.c

@@ -630,11 +630,7 @@ int net_switch_to_ssl(int sock) {
 
 
   debug0("net_switch_to_ssl()");
   debug0("net_switch_to_ssl()");
   sleep(3); // Give some time to let the connect() go through.
   sleep(3); // Give some time to let the connect() go through.
-  for (i = 0; i < MAXSOCKS; ++i) {
-    if (socklist[i].sock == sock && !(socklist[i].flags & SOCK_UNUSED)) {
-      break;
-    }
-  }
+  i = findanysnum(sock);
   if (i == MAXSOCKS) {
   if (i == MAXSOCKS) {
     debug0("Error while swithing to SSL - sock not found in list");
     debug0("Error while swithing to SSL - sock not found in list");
     return 0;
     return 0;