-2013.06.05, Version 0.10.10 (Stable)
+2013.06.13, Version 0.10.11 (Stable)
+
+Changes since version 0.10.10:
+
+* unix: unconditionally stop handle on close (Ben Noordhuis)
+
+* freebsd: don't enable dtrace if it's not available (Brian White)
+
+* build: make HAVE_DTRACE=0 should disable dtrace (Timothy J. Fontaine)
+
+* unix: remove overzealous assert (Ben Noordhuis)
+
+* unix: clear UV_STREAM_SHUTTING after shutdown() (Ben Noordhuis)
+
+* unix: fix busy loop, write if POLLERR or POLLHUP (Ben Noordhuis)
+
+
+2013.06.05, Version 0.10.10 (Stable), 0d95a88bd35fce93863c57a460be613aea34d2c5
Changes since version 0.10.9:
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv
-HAVE_DTRACE=
DTRACE_OBJS=
DTRACE_HEADER=
OBJS += src/version.o
ifeq (sunos,$(PLATFORM))
-HAVE_DTRACE=1
+HAVE_DTRACE ?= 1
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LDFLAGS+=-lkstat -lnsl -lsendfile -lsocket
# Library dependencies are not transitive.
OBJS += src/unix/sunos.o
+ifeq (1, $(HAVE_DTRACE))
OBJS += src/unix/dtrace.o
DTRACE_OBJS += src/unix/core.o
endif
+endif
ifeq (aix,$(PLATFORM))
CPPFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
endif
ifeq (darwin,$(PLATFORM))
-HAVE_DTRACE=1
+HAVE_DTRACE ?= 1
# dtrace(1) probes contain dollar signs on OS X. Mute the warnings they
# generate but only when CC=clang, -Wno-dollar-in-identifier-extension
# is a clang extension.
endif
ifeq (freebsd,$(PLATFORM))
-HAVE_DTRACE=1
+ifeq ($(shell dtrace -l 1>&2 2>/dev/null; echo $$?),0)
+HAVE_DTRACE ?= 1
+endif
LDFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
static void uv__drain(uv_stream_t* stream) {
uv_shutdown_t* req;
+ int status;
assert(ngx_queue_empty(&stream->write_queue));
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT);
req = stream->shutdown_req;
stream->shutdown_req = NULL;
+ stream->flags &= ~UV_STREAM_SHUTTING;
uv__req_unregister(stream->loop, req);
- if (shutdown(uv__stream_fd(stream), SHUT_WR)) {
- /* Error. Report it. User should call uv_close(). */
+ status = shutdown(uv__stream_fd(stream), SHUT_WR);
+ if (status)
uv__set_sys_error(stream->loop, errno);
- if (req->cb) {
- req->cb(req, -1);
- }
- } else {
- uv__set_sys_error(stream->loop, 0);
- ((uv_handle_t*) stream)->flags |= UV_STREAM_SHUT;
- if (req->cb) {
- req->cb(req, 0);
- }
- }
+ else
+ stream->flags |= UV_STREAM_SHUT;
+
+ if (req->cb != NULL)
+ req->cb(req, status);
}
}
return; /* read_cb closed stream. */
}
- if (events & UV__POLLOUT) {
+ if (events & (UV__POLLOUT | UV__POLLERR | UV__POLLHUP)) {
assert(uv__stream_fd(stream) >= 0);
uv__write(stream);
uv__write_callbacks(stream);
int uv_read_stop(uv_stream_t* stream) {
- /* Sanity check. We're going to stop the handle unless it's primed for
- * writing but that means there should be some kind of write action in
- * progress.
- */
- assert(!uv__io_active(&stream->io_watcher, UV__POLLOUT) ||
- !ngx_queue_empty(&stream->write_completed_queue) ||
- !ngx_queue_empty(&stream->write_queue) ||
- stream->shutdown_req != NULL ||
- stream->connect_req != NULL);
-
stream->flags &= ~UV_STREAM_READING;
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
if (!uv__io_active(&stream->io_watcher, UV__POLLOUT))
}
#endif /* defined(__APPLE__) */
- uv_read_stop(handle);
uv__io_close(handle->loop, &handle->io_watcher);
+ uv_read_stop(handle);
+ uv__handle_stop(handle);
close(handle->io_watcher.fd);
handle->io_watcher.fd = -1;