This really shouldn't have been a NO-JIRA commit. There are two distinct
changes here, both of which appear to have JIRAs with the associated patch
on it that have not been marked resolved and also weren't automatically
updated to reflect the commits due to excluding the reference in the commit
log.

https://issues.apache.org/jira/browse/PROTON-360
https://issues.apache.org/jira/browse/PROTON-361

Robbie

On 19 July 2013 12:13, <tr...@apache.org> wrote:

> Author: tross
> Date: Fri Jul 19 11:13:29 2013
> New Revision: 1504829
>
> URL: http://svn.apache.org/r1504829
> Log:
> NO-JIRA - Applied patches from Hiram Chirino and Bozo Dragojevic.
>
> Modified:
>
> qpid/proton/trunk/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
>
> Modified:
> qpid/proton/trunk/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
> URL:
> http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java?rev=1504829&r1=1504828&r2=1504829&view=diff
>
> ==============================================================================
> ---
> qpid/proton/trunk/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
> (original)
> +++
> qpid/proton/trunk/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/impl/AmqpTransport.java
> Fri Jul 19 11:13:29 2013
> @@ -109,7 +109,7 @@ public class AmqpTransport extends Watch
>
>                  @Override
>                  public void onFailure(Throwable value) {
> -                    if( state == CONNECTED ) {
> +                    if( state == CONNECTED || state == CONNECTING ) {
>                          failure = value;
>                          disconnect();
>                          fireWatches();
> @@ -237,25 +237,30 @@ public class AmqpTransport extends Watch
>                      }
>                      HashSet<String> mechanisims = new
> HashSet<String>(Arrays.asList(sasl.getRemoteMechanisms()));
>                      if (!authSent && !mechanisims.isEmpty()) {
> -                        if (!mechanisims.contains("PLAIN")) {
> +                        if (mechanisims.contains("PLAIN")) {
> +                            authSent = true;
> +                            DataByteArrayOutputStream os = new
> DataByteArrayOutputStream();
> +                            try {
> +                                os.writeByte(0);
> +                                os.write(new
> UTF8Buffer(options.getUser()));
> +                                os.writeByte(0);
> +                                if (options.getPassword() != null) {
> +                                    os.write(new
> UTF8Buffer(options.getPassword()));
> +                                }
> +                            } catch (IOException e) {
> +                                throw new RuntimeException(e);
> +                            }
> +                            Buffer buffer = os.toBuffer();
> +                            sasl.setMechanisms(new String[]{"PLAIN"});
> +                            sasl.send(buffer.data, buffer.offset,
> buffer.length);
> +                        } else if (mechanisims.contains("ANONYMOUS")) {
> +                            authSent = true;
> +                            sasl.setMechanisms(new String[]{"ANONYMOUS"});
> +                            sasl.send(new byte[0], 0, 0);
> +                        } else {
>                              next.onFailure(Support.illegalState("Remote
> does not support plain password authentication."));
>                              return null;
>                          }
> -                        authSent = true;
> -                        DataByteArrayOutputStream os = new
> DataByteArrayOutputStream();
> -                        try {
> -                            os.writeByte(0);
> -                            os.write(new UTF8Buffer(options.getUser()));
> -                            os.writeByte(0);
> -                            if (options.getPassword() != null) {
> -                                os.write(new
> UTF8Buffer(options.getPassword()));
> -                            }
> -                        } catch (IOException e) {
> -                            throw new RuntimeException(e);
> -                        }
> -                        Buffer buffer = os.toBuffer();
> -                        sasl.setMechanisms(new String[]{"PLAIN"});
> -                        sasl.send(buffer.data, buffer.offset,
> buffer.length);
>                      }
>                      return sasl;
>                  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
> For additional commands, e-mail: commits-h...@qpid.apache.org
>
>

Reply via email to