diff --git a/CHANGELOG b/CHANGELOG
index 619887090..549c1f6fd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+07-11-13 3.5.4
+. fixed issue with PAM audit when auth key is set
+. fixed issue in cn1 where global headers were not getting added
+. fixed issue in PAM, where ttl 0 was being considered invalid
+
07-09-13 3.5.3
. added constructor for setting iv
. beta1 of CN1 port
diff --git a/android/Pubnub-Android-3.5.3.jar b/android/Pubnub-Android-3.5.3.jar
index adf844c09..7a922cd1d 100644
Binary files a/android/Pubnub-Android-3.5.3.jar and b/android/Pubnub-Android-3.5.3.jar differ
diff --git a/android/examples/PubnubExample/libs/Pubnub-Android-3.5.3.jar b/android/examples/PubnubExample/libs/Pubnub-Android-3.5.3.jar
index adf844c09..7a922cd1d 100644
Binary files a/android/examples/PubnubExample/libs/Pubnub-Android-3.5.3.jar and b/android/examples/PubnubExample/libs/Pubnub-Android-3.5.3.jar differ
diff --git a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.3.jar b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.3.jar
index adf844c09..7a922cd1d 100644
Binary files a/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.3.jar and b/android/examples/SubscribeAtBoot/libs/Pubnub-Android-3.5.3.jar differ
diff --git a/blackberry/Pubnub-BlackBerry-3.5.3.jar b/blackberry/Pubnub-BlackBerry-3.5.3.jar
index d1ee55730..141f4f6a0 100644
Binary files a/blackberry/Pubnub-BlackBerry-3.5.3.jar and b/blackberry/Pubnub-BlackBerry-3.5.3.jar differ
diff --git a/codenameone/pubnub-codenameone-3.5.3.cn1lib b/codenameone/pubnub-codenameone-3.5.3.cn1lib
index 8a9a7e0ef..9f29149f2 100644
Binary files a/codenameone/pubnub-codenameone-3.5.3.cn1lib and b/codenameone/pubnub-codenameone-3.5.3.cn1lib differ
diff --git a/codenameone/src/com/pubnub/api/HttpClientCore.java b/codenameone/src/com/pubnub/api/HttpClientCore.java
index baa7f0d6d..cce79d152 100644
--- a/codenameone/src/com/pubnub/api/HttpClientCore.java
+++ b/codenameone/src/com/pubnub/api/HttpClientCore.java
@@ -59,7 +59,7 @@ public synchronized HttpResponse fetch(String url, Hashtable headers)
IOException excp = null;
PubnubCn1Response pcr = null;
try {
- pcr = connection.fetch(url, requestTimeout, headers);
+ pcr = connection.fetch(url, requestTimeout, PubnubUtil.hashtableClone(headers,_headers));
} catch (IOException ex) {
excp = ex;
}
diff --git a/j2me/Pubnub-MicroEdition-3.5.3.jar b/j2me/Pubnub-MicroEdition-3.5.3.jar
index a856cbbea..6e743f9d6 100644
Binary files a/j2me/Pubnub-MicroEdition-3.5.3.jar and b/j2me/Pubnub-MicroEdition-3.5.3.jar differ
diff --git a/java/Pubnub-StandardEdition-3.5.3.jar b/java/Pubnub-StandardEdition-3.5.3.jar
index 5974afb5d..50144b334 100644
Binary files a/java/Pubnub-StandardEdition-3.5.3.jar and b/java/Pubnub-StandardEdition-3.5.3.jar differ
diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html
index d6fd6f556..bcab8657d 100644
--- a/java/doc/allclasses-frame.html
+++ b/java/doc/allclasses-frame.html
@@ -2,12 +2,12 @@
-
+
All Classes
-
+
diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html
index 78492e75e..bb5825066 100644
--- a/java/doc/allclasses-noframe.html
+++ b/java/doc/allclasses-noframe.html
@@ -2,12 +2,12 @@
-
+
All Classes
-
+
diff --git a/java/doc/com/pubnub/api/Callback.html b/java/doc/com/pubnub/api/Callback.html
index 73eddf4fb..93fb71779 100644
--- a/java/doc/com/pubnub/api/Callback.html
+++ b/java/doc/com/pubnub/api/Callback.html
@@ -2,12 +2,12 @@
-
+
Callback
-
+
diff --git a/java/doc/com/pubnub/api/HttpUtil.html b/java/doc/com/pubnub/api/HttpUtil.html
index 11ef42090..24be458ac 100644
--- a/java/doc/com/pubnub/api/HttpUtil.html
+++ b/java/doc/com/pubnub/api/HttpUtil.html
@@ -2,12 +2,12 @@
-
+
HttpUtil
-
+
diff --git a/java/doc/com/pubnub/api/Pubnub.html b/java/doc/com/pubnub/api/Pubnub.html
index 7e80be5db..f2a01cfff 100644
--- a/java/doc/com/pubnub/api/Pubnub.html
+++ b/java/doc/com/pubnub/api/Pubnub.html
@@ -2,12 +2,12 @@
-
+
Pubnub
-
+
diff --git a/java/doc/com/pubnub/api/PubnubError.html b/java/doc/com/pubnub/api/PubnubError.html
index 1cf765490..763ae6e8e 100644
--- a/java/doc/com/pubnub/api/PubnubError.html
+++ b/java/doc/com/pubnub/api/PubnubError.html
@@ -2,12 +2,12 @@
-
+
PubnubError
-
+
diff --git a/java/doc/com/pubnub/api/PubnubException.html b/java/doc/com/pubnub/api/PubnubException.html
index cbc6ee775..fbddd4ea3 100644
--- a/java/doc/com/pubnub/api/PubnubException.html
+++ b/java/doc/com/pubnub/api/PubnubException.html
@@ -2,12 +2,12 @@
-
+
PubnubException
-
+
diff --git a/java/doc/com/pubnub/api/PubnubUtil.html b/java/doc/com/pubnub/api/PubnubUtil.html
index cf9b9e56c..398017dcb 100644
--- a/java/doc/com/pubnub/api/PubnubUtil.html
+++ b/java/doc/com/pubnub/api/PubnubUtil.html
@@ -2,12 +2,12 @@
-
+
PubnubUtil
-
+
diff --git a/java/doc/com/pubnub/api/package-frame.html b/java/doc/com/pubnub/api/package-frame.html
index 134dd2f08..e89132bba 100644
--- a/java/doc/com/pubnub/api/package-frame.html
+++ b/java/doc/com/pubnub/api/package-frame.html
@@ -2,12 +2,12 @@
-
+
com.pubnub.api
-
+
diff --git a/java/doc/com/pubnub/api/package-summary.html b/java/doc/com/pubnub/api/package-summary.html
index 8a28190ac..d47275b56 100644
--- a/java/doc/com/pubnub/api/package-summary.html
+++ b/java/doc/com/pubnub/api/package-summary.html
@@ -2,12 +2,12 @@
-
+
com.pubnub.api
-
+
diff --git a/java/doc/com/pubnub/api/package-tree.html b/java/doc/com/pubnub/api/package-tree.html
index bef6a5c5b..5bcb37901 100644
--- a/java/doc/com/pubnub/api/package-tree.html
+++ b/java/doc/com/pubnub/api/package-tree.html
@@ -2,12 +2,12 @@
-
+
com.pubnub.api Class Hierarchy
-
+
diff --git a/java/doc/constant-values.html b/java/doc/constant-values.html
index cc0ae2a92..02d163e02 100644
--- a/java/doc/constant-values.html
+++ b/java/doc/constant-values.html
@@ -2,12 +2,12 @@
-
+
Constant Field Values
-
+
diff --git a/java/doc/deprecated-list.html b/java/doc/deprecated-list.html
index fdcc2b507..291fc04be 100644
--- a/java/doc/deprecated-list.html
+++ b/java/doc/deprecated-list.html
@@ -2,12 +2,12 @@
-
+
Deprecated List
-
+
diff --git a/java/doc/help-doc.html b/java/doc/help-doc.html
index bbffd65e3..0da7c8f50 100644
--- a/java/doc/help-doc.html
+++ b/java/doc/help-doc.html
@@ -2,12 +2,12 @@
-
+
API Help
-
+
diff --git a/java/doc/index-all.html b/java/doc/index-all.html
index a40e9ca65..02210af4e 100644
--- a/java/doc/index-all.html
+++ b/java/doc/index-all.html
@@ -2,12 +2,12 @@
-
+
Index
-
+
diff --git a/java/doc/index.html b/java/doc/index.html
index fc50c6cf7..864462af7 100644
--- a/java/doc/index.html
+++ b/java/doc/index.html
@@ -2,7 +2,7 @@
-
+
Generated Documentation (Untitled)
diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html
index 682d29a35..227fb6ad1 100644
--- a/java/doc/overview-tree.html
+++ b/java/doc/overview-tree.html
@@ -2,12 +2,12 @@
-
+
Class Hierarchy
-
+
diff --git a/java/doc/serialized-form.html b/java/doc/serialized-form.html
index b0f1863c2..c404ba6bd 100644
--- a/java/doc/serialized-form.html
+++ b/java/doc/serialized-form.html
@@ -2,12 +2,12 @@
-
+
Serialized Form
-
+
diff --git a/java/jars/Pubnub-UnitTests-3.5.3.jar b/java/jars/Pubnub-UnitTests-3.5.3.jar
index 0e78f56dc..b5158d20c 100644
Binary files a/java/jars/Pubnub-UnitTests-3.5.3.jar and b/java/jars/Pubnub-UnitTests-3.5.3.jar differ
diff --git a/java/jars/PubnubDemoConsole.jar b/java/jars/PubnubDemoConsole.jar
index 47b2ffc88..1d46ff86a 100644
Binary files a/java/jars/PubnubDemoConsole.jar and b/java/jars/PubnubDemoConsole.jar differ
diff --git a/java/jars/PubnubExample.jar b/java/jars/PubnubExample.jar
index de10e5377..ee2429d8e 100644
Binary files a/java/jars/PubnubExample.jar and b/java/jars/PubnubExample.jar differ
diff --git a/java/src/com/pubnub/api/Pubnub.java b/java/src/com/pubnub/api/Pubnub.java
index e59fcec5f..5a5f38e8e 100644
--- a/java/src/com/pubnub/api/Pubnub.java
+++ b/java/src/com/pubnub/api/Pubnub.java
@@ -579,7 +579,7 @@ private String pamSign(String key, String data) throws PubnubException {
*/
public void pamGrant(final String channel, String auth_key, boolean read,
boolean write, final Callback callback) {
- pamGrant(channel, auth_key, read, write, 0, callback);
+ pamGrant(channel, auth_key, read, write, -1, callback);
}
/** Grant r/w access based on channel and auth key
@@ -592,7 +592,7 @@ public void pamGrant(final String channel, String auth_key, boolean read,
public void pamGrant(final String channel, String auth_key, boolean read,
boolean write, int ttl, final Callback callback) {
- Hashtable parameters = hashtableClone(params);
+ Hashtable parameters = PubnubUtil.hashtableClone(params);
String r = (read) ? "1" : "0";
String w = (write) ? "1" : "0";
@@ -610,7 +610,7 @@ public void pamGrant(final String channel, String auth_key, boolean read,
String sign_input = this.SUBSCRIBE_KEY + "\n" + this.PUBLISH_KEY + "\n"
+ "grant" + "\n" + "auth=" + auth_key + "&" + "channel="
+ channel + "&" + "r=" + r + "&" + "timestamp=" + timestamp
- + ((ttl > 0)?"&" + "ttl=" + ttl:"")
+ + ((ttl > -1)?"&" + "ttl=" + ttl:"")
+ "&" + "w=" + w;
@@ -665,7 +665,8 @@ public void handleError(HttpRequest hreq, PubnubError error) {
*/
public void pamAudit(final Callback callback) {
- Hashtable parameters = hashtableClone(params);
+ Hashtable parameters = PubnubUtil.hashtableClone(params);
+ parameters.remove("auth");
String signature = "0";
@@ -729,7 +730,8 @@ public void handleError(HttpRequest hreq, PubnubError error) {
public void pamAudit(final String channel,
final Callback callback) {
- Hashtable parameters = hashtableClone(params);
+ Hashtable parameters = PubnubUtil.hashtableClone(params);
+ parameters.remove("auth");
String signature = "0";
@@ -794,7 +796,7 @@ public void handleError(HttpRequest hreq, PubnubError error) {
public void pamAudit(final String channel, String auth_key,
final Callback callback) {
- Hashtable parameters = hashtableClone(params);
+ Hashtable parameters = PubnubUtil.hashtableClone(params);
String signature = "0";
diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubCore.java
index f2a33caf0..0c352433e 100644
--- a/java/srcPubnubApi/com/pubnub/api/PubnubCore.java
+++ b/java/srcPubnubApi/com/pubnub/api/PubnubCore.java
@@ -146,20 +146,6 @@ public boolean getCacheBusting() {
return this.CACHE_BUSTING;
}
- protected Hashtable hashtableClone(Hashtable ht) {
- if (ht == null)
- return null;
-
- Hashtable htresp = new Hashtable();
- Enumeration e = ht.keys();
-
- while (e.hasMoreElements()) {
- Object element = e.nextElement();
- htresp.put(element, ht.get(element));
- }
- return htresp;
- }
-
/**
* This method returns all channel names currently subscribed to in form of
* a comma separated String
@@ -747,7 +733,7 @@ public void handleError(HttpRequest hreq, PubnubError error) {
*/
public void detailedHistory(final String channel, long start, long end,
int count, boolean reverse, final Callback callback) {
- Hashtable parameters = hashtableClone(params);
+ Hashtable parameters = PubnubUtil.hashtableClone(params);
if (count == -1)
count = 100;
@@ -1288,7 +1274,7 @@ private void _subscribe_base(boolean fresh, boolean dar, Worker worker) {
};
- Hashtable params = hashtableClone(this.params);
+ Hashtable params = PubnubUtil.hashtableClone(this.params);
params.put("uuid", UUID);
log.verbose("Subscribing with timetoken : " + _timetoken);
diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java
index 4ebe910e5..36db0ff3c 100644
--- a/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java
+++ b/java/srcPubnubApi/com/pubnub/api/PubnubUtilCore.java
@@ -138,4 +138,55 @@ public static synchronized String hashTableKeysToDelimitedString(
}
+ static Hashtable hashtableClone(Hashtable ht) {
+ if (ht == null)
+ return null;
+
+ Hashtable htresp = new Hashtable();
+ Enumeration e = ht.keys();
+
+ while (e.hasMoreElements()) {
+ Object element = e.nextElement();
+ htresp.put(element, ht.get(element));
+ }
+ return htresp;
+ }
+
+ static Hashtable hashtableClone(Hashtable ht1, Hashtable ht2) {
+ if (ht1 == null && ht2 == null)
+ return null;
+
+ Hashtable htresp = new Hashtable();
+
+ if (ht1 != null) {
+ Enumeration e = ht1.keys();
+ while (e.hasMoreElements()) {
+ Object element = e.nextElement();
+ htresp.put(element, ht1.get(element));
+ }
+ }
+ if (ht2 != null) {
+ Enumeration e = ht2.keys();
+ while (e.hasMoreElements()) {
+ Object element = e.nextElement();
+ htresp.put(element, ht2.get(element));
+ }
+ }
+ return htresp;
+ }
+
+ static Hashtable hashtableMerge(Hashtable dst, Hashtable src) {
+ if (dst == null)
+ return src;
+ if (src == null)
+ return dst;
+
+ Enumeration e = src.keys();
+
+ while (e.hasMoreElements()) {
+ Object element = e.nextElement();
+ dst.put(element, src.get(element));
+ }
+ return dst;
+ }
}
\ No newline at end of file