Skip to content

Commit

Permalink
Merge tag '4.1.7'
Browse files Browse the repository at this point in the history
Smack 4.1.7
  • Loading branch information
Flowdalic committed Apr 14, 2016
2 parents a4fc39d + 145fa02 commit b94b258
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 9 deletions.
20 changes: 20 additions & 0 deletions resources/releasedocs/changelog.html
Expand Up @@ -141,6 +141,26 @@ <h1>Smack Changelog</h1>

<div id="pageBody">

<h2>4.1.7 -- <span style="font-weight: normal;">2016-04-14</span></h2>

<h2> Bug
</h2>
<ul>
<li>[<a href='https://igniterealtime.org/issues/browse/SMACK-712'>SMACK-712</a>] - XMPPTCPConnection&#39;s setEnabledSSL(Protocols|Ciphers) has no effect
</li>
<li>[<a href='https://igniterealtime.org/issues/browse/SMACK-716'>SMACK-716</a>] - EntityTimeManager.getTime() does not set the recipients JID
</li>
<li>[<a href='https://igniterealtime.org/issues/browse/SMACK-719'>SMACK-719</a>] - XMPPError should use Locale.US in toUpperCase()
</li>
</ul>

<h2> Improvement
</h2>
<ul>
<li>[<a href='https://igniterealtime.org/issues/browse/SMACK-715'>SMACK-715</a>] - Add Roster.setRosterLoadedAtLoginDefault(boolean)
</li>
</ul>

<h2>4.1.6 -- <span style="font-weight: normal;">2016-01-23</span></h2>

<h2> Bug
Expand Down
Expand Up @@ -57,6 +57,6 @@ public boolean accept(Stanza packet) {

@Override
public String toString() {
return getClass().getSimpleName() + ": " + packetType.getName();
return getClass().getSimpleName() + ": " + packetType.getSimpleName();
}
}
Expand Up @@ -19,6 +19,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;

Expand Down Expand Up @@ -361,13 +362,11 @@ public static enum Type {

@Override
public String toString() {
// Locale.US not required, since Type consists only of ASCII chars
return name().toLowerCase();
return name().toLowerCase(Locale.US);
}

public static Type fromString(String string) {
// Locale.US not required, since Type consists only of ASCII chars
string = string.toUpperCase();
string = string.toUpperCase(Locale.US);
return Type.valueOf(string);
}
}
Expand Down
Expand Up @@ -108,6 +108,8 @@ public Time getTime(Jid jid) throws NoResponseException, XMPPErrorException, Not
return null;

Time request = new Time();
// TODO Add Time(Jid) constructor and use this constructor instead
request.setTo(jid);
Time response = (Time) connection().createPacketCollectorAndSend(request).nextResultOrThrow();
return response;
}
Expand Down
12 changes: 12 additions & 0 deletions smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
Expand Up @@ -1061,6 +1061,18 @@ public boolean isSubscribedToMyPresence(Jid jid) {
}
}

/**
* Sets if the roster will be loaded from the server when logging in for newly created instances
* of {@link Roster}.
*
* @param rosterLoadedAtLoginDefault if the roster will be loaded from the server when logging in.
* @see #setRosterLoadedAtLogin(boolean)
* @since 4.1.7
*/
public static void setRosterLoadedAtLoginDefault(boolean rosterLoadedAtLoginDefault) {
Roster.rosterLoadedAtLoginDefault = rosterLoadedAtLoginDefault;
}

/**
* Sets if the roster will be loaded from the server when logging in. This
* is the common behaviour for clients but sometimes clients may want to differ this
Expand Down
@@ -1,6 +1,6 @@
/**
*
* Copyright 2014 Florian Schmaus
* Copyright 2014-2016 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,7 @@
import de.measite.minidns.Record;
import de.measite.minidns.Record.CLASS;
import de.measite.minidns.Record.TYPE;
import de.measite.minidns.record.Data;
import de.measite.minidns.record.SRV;


Expand Down Expand Up @@ -81,7 +82,11 @@ public List<SRVRecord> lookupSRVRecords(String name) {
return res;
}
for (Record record : message.getAnswers()) {
SRV srv = (SRV) record.getPayload();
Data data = record.getPayload();
if (!(data instanceof SRV)) {
continue;
}
SRV srv = (SRV) data;
res.add(new SRVRecord(srv.getName(), srv.getPort(), srv.getPriority(), srv.getWeight()));
}
return res;
Expand Down
Expand Up @@ -741,12 +741,16 @@ else if (keyStoreType != null){
// Secure the plain connection
socket = context.getSocketFactory().createSocket(plain,
host, plain.getPort(), true);
// Initialize the reader and writer with the new secured version
initReaderAndWriter();

final SSLSocket sslSocket = (SSLSocket) socket;
// Immediately set the enabled SSL protocols and ciphers. See SMACK-712 why this is
// important (at least on certain platforms) and it seems to be a good idea anyways to
// prevent an accidental implicit handshake.
TLSUtils.setEnabledProtocolsAndCiphers(sslSocket, config.getEnabledSSLProtocols(), config.getEnabledSSLCiphers());

// Initialize the reader and writer with the new secured version
initReaderAndWriter();

// Proceed to do the handshake
sslSocket.startHandshake();

Expand Down

0 comments on commit b94b258

Please sign in to comment.