Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@

<h1>HTTP File Upload Plugin Changelog</h1>

<p><b>1.5.0</b> -- (tbd)</p>
<ul>
<li>Now requires Openfire 4.8.1 or later</li>
<li><a href="https://github.com/igniterealtime/openfire-httpFileUpload-plugin/issues/43">Issue #43:</a> ClassCastExceptions after reloading plugin in a cluster.</li>
</ul>

<p><b>1.4.2</b> -- (November 19, 2024)</p>
<ul>
<li>Updated Chinese (zh_CN) translation</li>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<author>Guus der Kinderen</author>
<version>${project.version}</version>
<date>2024-11-19</date>
<minServerVersion>4.7.0</minServerVersion>
<minServerVersion>4.8.1</minServerVersion>
<priorToServerVersion>5.0.0</priorToServerVersion>
<minJavaVersion>1.8</minJavaVersion>
<csrfProtectionEnabled>true</csrfProtectionEnabled>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.7.0</version>
<version>4.8.1</version>
</parent>
<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>httpfileupload</artifactId>
<name>HTTP File Upload Plugin</name>
<description>Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.</description>
<version>1.4.3-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>

<distributionManagement>
<!-- Repository in which we deploy this project, when desired. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2022 Ignite Realtime Foundation. All rights reserved.
* Copyright (c) 2017-2024 Ignite Realtime Foundation. All rights reserved.
*
* 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 @@ -29,10 +29,11 @@

public class OpenfireSlotProvider implements SlotProvider
{
private final Cache<SecureUniqueId, Slot> slotsCache;
// Use string-representation of SecureUniqueId as cache key, as the interface cannot be processed by JAXB.
private final Cache<String, Slot> slotsCache;

public OpenfireSlotProvider() {
slotsCache = CacheFactory.createCache("HTTP File Upload Slots");
slotsCache = CacheFactory.createSerializingCache("HTTP File Upload Slots", String.class, Slot.class);

// Unless there is specific configuration for this cache, default the max lifetime of entries in this cache to something that's fairly short.
if (null == JiveGlobals.getProperty("cache." + slotsCache.getName().replaceAll(" ", "") + ".maxLifetime")) {
Expand All @@ -43,10 +44,10 @@ public OpenfireSlotProvider() {
@Override
public void create(@Nonnull final Slot slot)
{
final Lock lock = slotsCache.getLock(slot.getUuid());
final Lock lock = slotsCache.getLock(slot.getUuid().toString());
lock.lock();
try {
slotsCache.put( slot.getUuid(), slot );
slotsCache.put( slot.getUuid().toString(), slot );
} finally {
lock.unlock();
}
Expand All @@ -56,10 +57,10 @@ public void create(@Nonnull final Slot slot)
@Override
public Slot consume(@Nonnull final SecureUniqueId slotId)
{
final Lock lock = slotsCache.getLock(slotId);
final Lock lock = slotsCache.getLock(slotId.toString());
lock.lock();
try {
return slotsCache.remove(slotId);
return slotsCache.remove(slotId.toString());
} finally {
lock.unlock();
}
Expand Down