You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sean Qiu (JIRA)" <ji...@apache.org> on 2006/12/31 06:39:21 UTC

[jira] Created: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

[classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
-----------------------------------------------------------------------------------------

                 Key: HARMONY-2930
                 URL: http://issues.apache.org/jira/browse/HARMONY-2930
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Ubuntu
            Reporter: Sean Qiu


Test:

    public void test_SocketWithProxy() throws IOException {
        //Confiure a available proxy here
        InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);

        Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));

        InetAddress address = InetAddress.getByName("localhost");
        int port = 23232;

        socket.bind(new InetSocketAddress(address, port));

        assertEquals(port, socket.getLocalPort());
        assertEquals(address, socket.getLocalAddress());
    }

Result:
RI passes
Harmony fails

While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu updated HARMONY-2930:
------------------------------

    Attachment:     (was: patch.diff)

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu updated HARMONY-2930:
------------------------------

    Patch Info: [Patch Available]

Would you pls try my patch. Thanks a lot!

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Attachments: patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu updated HARMONY-2930:
------------------------------

    Attachment: patch-V2.diff

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch-V2.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu updated HARMONY-2930:
------------------------------

    Attachment: patch.diff

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Attachments: patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463788 ] 

Sean Qiu commented on HARMONY-2930:
-----------------------------------

Thanks, Tim. It now has some system dependency.
So i have supplied a new patch.
Sorry for inconvenience caused.

I assign the port with 0 to make it available.
it looks like:

int port = 0;
...
assertTrue(port!=socket.getLocalPort());

Could you pls try it again? Thanks a lot.

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch-V2.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison closed HARMONY-2930.
--------------------------------


Verified by Sean.


> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch-V2.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464064 ] 

Sean Qiu commented on HARMONY-2930:
-----------------------------------

Verified at r495393, thanks Tim.

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch-V2.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu updated HARMONY-2930:
------------------------------

    Attachment: patch.diff

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-2930.
----------------------------------

    Resolution: Fixed

Thanks Sean.

Patch applied to LUNI module at repo revision r495393.

Please verify it was applied properly.


> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch-V2.diff, patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-2930:
------------------------------------

    Assignee: Tim Ellison

> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2930) [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463520 ] 

Tim Ellison commented on HARMONY-2930:
--------------------------------------

I just have a problem with the test case relying upon port 22323 being free, rather than binding to any available port.  Given that this is a regression test can we change the assertion to be socket.getLocalAddress() != 1080 ?


> [classlib][luni]java.net.Socket cann't bind the local address when constructed with proxy
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2930
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2930
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Ubuntu
>            Reporter: Sean Qiu
>         Assigned To: Tim Ellison
>         Attachments: patch.diff
>
>
> Test:
>     public void test_SocketWithProxy() throws IOException {
>         //Confiure a available proxy here
>         InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName("Your proxy host"), 80);
>         Socket socket = new Socket(new Proxy(Proxy.Type.SOCKS, isa));
>         InetAddress address = InetAddress.getByName("localhost");
>         int port = 23232;
>         socket.bind(new InetSocketAddress(address, port));
>         assertEquals(port, socket.getLocalPort());
>         assertEquals(address, socket.getLocalAddress());
>     }
> Result:
> RI passes
> Harmony fails
> While constructing a new socket with proxy, in contrast with RI, Harmony will keep the address and port zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira