-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#331 etags on uploads #577
Conversation
|
||
interface Hasher { | ||
@Throws(IOException::class) | ||
fun getMHash(file: Path): String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_M_Hash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mhash
predates this PR: https://github.com/Qabel/qabel-core/search?utf8=%E2%9C%93&q=mhash
It was an evolution from mtime to "still mtime but let's not call it time" ;)
But sure, this Interface doesn't need to know anything about that legacy
@Test | ||
fun uploadsSuccessfulIfEtagIsUpToDate() { | ||
val upload = writeBackend.upload("file", fakeDataStream()) | ||
writeBackend.upload("file", fakeDataStream("new"), upload.etag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert that an etag actually exists and is not the empty string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
companion object { | ||
// Number of http connections to S3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not S3 anymore
You may resolve the remaining "issues" in a seperate pr ;) |
// Number of http connections to S3 | ||
// The default was too low, 20 works. Further testing may be required | ||
// to find the best amount of connections. | ||
protected val CONNECTIONS = 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using HTTP pipelining should reduce that number to essentially 1. (pipelining POSTs is safe for this application imho). create ticket?
Create ticket. |
import org.apache.http.client.methods.HttpPost | ||
import org.apache.http.client.utils.DateUtils | ||
import org.apache.http.entity.InputStreamEntity | ||
import sun.plugin.dom.exception.InvalidStateException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autoimport o.O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be IllegalStateException?
resolves Qabel/qabel-desktop#331