eliminate use of String-case macro
[org.ibex.net.git] / src / org / ibex / net / HTTP.java
index 5cab19d..f7be3d8 100644 (file)
@@ -47,7 +47,7 @@ public class HTTP {
             private Hash h = new Hash();
             public String getCookieHeader(String domain, String path, boolean secure) {
                 StringBuffer ret = new StringBuffer("Cookie: ");
-                Enumeration e = h.keys();
+                Enumeration e = h.enumerateKeys();
                 while (e.hasMoreElements()) {
                     Vec v = (Vec)h.get(e.nextElement());
                     Cookie cookie = null;
@@ -89,11 +89,9 @@ public class HTTP {
                         value = end;
                         continue;
                     }
-                    //#switch(start.toLowerCase())
-                    case "domain":  domain = end;
-                    case "path":    path = end;
-                    case "expires": expires = new Date(end);
-                        //#end
+                    if      (start.toLowerCase().equals("domain")) domain = end;
+                    else if (start.toLowerCase().equals("path")) path = end;
+                    else if (start.toLowerCase().equals("expires")) expires = new Date(end);
                 }
                 if (h.get(name) == null) h.put(name, new Vec());
                 ((Vec)h.get(name)).addElement(new Cookie(name, value, domain, path, expires, secure));
@@ -762,7 +760,7 @@ public class HTTP {
                 DataOutputStream dos = new DataOutputStream(sock.getOutputStream());
                 dos.writeByte(0x04);                         // SOCKSv4(a)
                 dos.writeByte(0x01);                         // CONNECT
-                dos.writeShort(http.port & 0xffff);               // port
+                dos.writeShort(http.port & 0xffff);          // port
                 if (addr == null) dos.writeInt(0x00000001);  // bogus IP
                 else dos.write(addr.getAddress());           // actual IP
                 dos.writeByte(0x00);                         // no userid