-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client: - allow passing single exe to simplify wrappers - don't fetch unnecessary data Server: - verify signatures in background, don't make the client wait - don't read unused entries/signatures
- Loading branch information
Showing
35 changed files
with
1,368 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
_pkgname=dxvk-cache-pool | ||
pkgname=("dxvk-cache-server-git" "dxvk-cache-client-git") | ||
# Maintainer: rc.poison <rc dot poison at gmail dot com> | ||
|
||
pkgbase=dxvk-cache-pool | ||
pkgname=("dxvk-cache-client-git" "dxvk-cache-server-git") | ||
pkgver=r149.0291c01 | ||
pkgrel=1 | ||
pkgdesc='Client/server to share DXVK pipeline caches.' | ||
pkgdesc='Client/server to share DXVK pipeline caches for smoother wine gaming.' | ||
arch=('any') | ||
url='https://github.com/rcpoison/dxvk-cache-pool' | ||
license=('Apache') | ||
license=('Apache 2') | ||
depends=('java-runtime>=8') | ||
makedepends=('git' 'maven' 'java-environment>=8') | ||
source=('git+https://github.com/rcpoison/dxvk-cache-pool.git') | ||
sha1sums=('SKIP') | ||
|
||
pkgver() { | ||
cd "$_pkgname" | ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | ||
cd "$pkgbase" | ||
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | ||
} | ||
|
||
|
||
build() { | ||
cd "$_pkgname" | ||
cd "$pkgbase" | ||
./build.sh | ||
} | ||
|
||
package_dxvk-cache-server-git() { | ||
cd "$_pkgname" | ||
cd "$pkgbase" | ||
install -Dm755 dxvk-cache-server -t "$pkgdir"/usr/bin | ||
install -Dm644 dxvk-cache-server.service -t "$pkgdir"/usr/lib/systemd/system/ | ||
} | ||
|
||
package_dxvk-cache-client-git() { | ||
cd "$_pkgname" | ||
cd "$pkgbase" | ||
install -Dm755 dxvk-cache-client -t "$pkgdir"/usr/bin | ||
install -Dm755 dxvk-cache-pool.sh -t "$pkgdir"/etc/profile.d | ||
} |
407 changes: 25 additions & 382 deletions
407
...client/src/main/java/com/ignorelist/kassandra/dxvk/cache/pool/client/CachePoolClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
397 changes: 397 additions & 0 deletions
397
...client/src/main/java/com/ignorelist/kassandra/dxvk/cache/pool/client/CachePoolMerger.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...main/java/com/ignorelist/kassandra/dxvk/cache/pool/common/api/PredicatePublicKeyInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.ignorelist.kassandra.dxvk.cache.pool.common.api; | ||
|
||
import com.google.common.base.Predicate; | ||
import com.google.common.collect.ImmutableSet; | ||
import com.ignorelist.kassandra.dxvk.cache.pool.common.crypto.PublicKeyInfo; | ||
import com.ignorelist.kassandra.dxvk.cache.pool.common.model.PredicateStateCacheEntrySigned; | ||
import java.util.Set; | ||
|
||
/** | ||
* | ||
* @author poison | ||
*/ | ||
public class PredicatePublicKeyInfo implements Predicate<PublicKeyInfo> { | ||
|
||
private final IdentityStorage identityStorage; | ||
private final ImmutableSet<PublicKeyInfo> acceptedPublicKeys; | ||
private final boolean onlyAcceptVerifiedKeys; | ||
|
||
public PredicatePublicKeyInfo(final IdentityStorage identityStorage, final ImmutableSet<PublicKeyInfo> acceptedPublicKeys, final boolean onlyAcceptVerifiedKeys) { | ||
this.identityStorage=identityStorage; | ||
this.acceptedPublicKeys=acceptedPublicKeys; | ||
this.onlyAcceptVerifiedKeys=onlyAcceptVerifiedKeys; | ||
} | ||
|
||
@Override | ||
public boolean apply(PublicKeyInfo input) { | ||
boolean accept=true; | ||
if (onlyAcceptVerifiedKeys) { | ||
accept&=null!=identityStorage.getIdentity(input); | ||
} | ||
if (null!=acceptedPublicKeys) { | ||
accept&=acceptedPublicKeys.contains(input); | ||
} | ||
return accept; | ||
} | ||
|
||
public static PredicatePublicKeyInfo buildFrom(final IdentityStorage identityStorage, final PredicateStateCacheEntrySigned predicateStateCacheEntrySigned) { | ||
if (null!=predicateStateCacheEntrySigned.getAcceptedPublicKeys()) { | ||
Set<PublicKeyInfo> accepted=predicateStateCacheEntrySigned.getAcceptedPublicKeys().getAcceptedPublicKeys(); | ||
if (null!=accepted&&!accepted.isEmpty()) { | ||
return new PredicatePublicKeyInfo(identityStorage, ImmutableSet.copyOf(accepted), predicateStateCacheEntrySigned.isOnlyAcceptVerifiedKeys()); | ||
} | ||
} | ||
return new PredicatePublicKeyInfo(identityStorage, null, predicateStateCacheEntrySigned.isOnlyAcceptVerifiedKeys()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
.../src/main/java/com/ignorelist/kassandra/dxvk/cache/pool/common/crypto/SignatureCount.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.ignorelist.kassandra.dxvk.cache.pool.common.crypto; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import com.google.common.collect.Multiset; | ||
import java.io.Serializable; | ||
import java.util.Comparator; | ||
import java.util.Set; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/** | ||
* | ||
* @author poison | ||
*/ | ||
@XmlRootElement | ||
public class SignatureCount implements Serializable, Comparable<SignatureCount> { | ||
|
||
private static final Comparator<SignatureCount> DEFAULT_COMPARATOR=Comparator | ||
.comparingInt(SignatureCount::getSignatureCount) | ||
.thenComparingInt(SignatureCount::getEntryCount); | ||
|
||
private int signatureCount; | ||
private int entryCount; | ||
|
||
public SignatureCount() { | ||
} | ||
|
||
public SignatureCount(int signature, int count) { | ||
this.signatureCount=signature; | ||
this.entryCount=count; | ||
} | ||
|
||
public SignatureCount(Multiset.Entry<Integer> e) { | ||
this(e.getElement(), e.getCount()); | ||
} | ||
|
||
public int getSignatureCount() { | ||
return signatureCount; | ||
} | ||
|
||
public void setSignatureCount(int signatureCount) { | ||
this.signatureCount=signatureCount; | ||
} | ||
|
||
public int getEntryCount() { | ||
return entryCount; | ||
} | ||
|
||
public void setEntryCount(int entryCount) { | ||
this.entryCount=entryCount; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int hash=3; | ||
hash=71*hash+this.signatureCount; | ||
hash=71*hash+this.entryCount; | ||
return hash; | ||
} | ||
|
||
public static Set<SignatureCount> build(Multiset<Integer> stats) { | ||
return stats.entrySet().stream() | ||
.map(SignatureCount::new) | ||
.collect(ImmutableSet.toImmutableSet()); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this==obj) { | ||
return true; | ||
} | ||
if (obj==null) { | ||
return false; | ||
} | ||
if (getClass()!=obj.getClass()) { | ||
return false; | ||
} | ||
final SignatureCount other=(SignatureCount) obj; | ||
if (this.signatureCount!=other.signatureCount) { | ||
return false; | ||
} | ||
if (this.entryCount!=other.entryCount) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public int compareTo(SignatureCount o) { | ||
return DEFAULT_COMPARATOR.compare(this, o); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.