Upgrade to latest eventcore.

This commit is contained in:
Sönke Ludwig 2017-01-25 21:04:13 +01:00
parent 2acc60934f
commit 5f980acefd
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C
3 changed files with 6 additions and 6 deletions

View file

@ -4,7 +4,7 @@ authors "Sönke Ludwig"
copyright "Copyright © 2016, rejectedsoftware e.K." copyright "Copyright © 2016, rejectedsoftware e.K."
license "MIT" license "MIT"
dependency "eventcore" version="~>0.7.0" dependency "eventcore" version="~>0.8.0"
targetName "vibe_core" targetName "vibe_core"

View file

@ -414,7 +414,7 @@ struct FileStream {
eventDriver.files.releaseRef(m_fd); eventDriver.files.releaseRef(m_fd);
} }
@property int fd() { return m_fd; } @property int fd() { return cast(int)m_fd; }
/// The path of the file. /// The path of the file.
@property Path path() const { return ctx.path; } @property Path path() const { return ctx.path; }
@ -497,7 +497,7 @@ logDebug("Written %s", res[2]);
write(cast(const(ubyte)[])bytes); write(cast(const(ubyte)[])bytes);
} }
void write(InputStream)(InputStream stream, ulong nbytes = 0) void write(InputStream)(InputStream stream, ulong nbytes = ulong.max)
if (isInputStream!InputStream) if (isInputStream!InputStream)
{ {
writeDefault(this, stream, nbytes); writeDefault(this, stream, nbytes);
@ -519,7 +519,7 @@ logDebug("Written %s", res[2]);
mixin validateRandomAccessStream!FileStream; mixin validateRandomAccessStream!FileStream;
private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, InputStream stream, ulong nbytes = 0) private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, InputStream stream, ulong nbytes = ulong.max)
if (isOutputStream!OutputStream && isInputStream!InputStream) if (isOutputStream!OutputStream && isInputStream!InputStream)
{ {
import vibe.internal.allocator : theAllocator, make, dispose; import vibe.internal.allocator : theAllocator, make, dispose;
@ -531,7 +531,7 @@ private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, Input
auto buffer = bufferobj.bytes[]; auto buffer = bufferobj.bytes[];
//logTrace("default write %d bytes, empty=%s", nbytes, stream.empty); //logTrace("default write %d bytes, empty=%s", nbytes, stream.empty);
if (nbytes == 0) { if (nbytes == ulong.max) {
while (!stream.empty) { while (!stream.empty) {
size_t chunk = min(stream.leastSize, buffer.length); size_t chunk = min(stream.leastSize, buffer.length);
assert(chunk > 0, "leastSize returned zero for non-empty stream."); assert(chunk > 0, "leastSize returned zero for non-empty stream.");

View file

@ -840,7 +840,7 @@ struct ManualEvent {
if (w.m_driver is drv) lw = w; if (w.m_driver is drv) lw = w;
else { else {
try { try {
() @trusted { return cast(shared)w.m_driver; } ().events.trigger(w.m_event); () @trusted { return cast(shared)w.m_driver; } ().events.trigger(w.m_event, true);
} catch (Exception e) assert(false, e.msg); } catch (Exception e) assert(false, e.msg);
} }
return true; return true;