Browse Source

uv: Upgrade to v0.10.9

v0.10.9-release
isaacs 12 years ago
parent
commit
f523f7041d
  1. 15
      deps/uv/ChangeLog
  2. 9
      deps/uv/src/unix/core.c
  3. 23
      deps/uv/src/unix/stream.c
  4. 3
      deps/uv/src/uv-common.h
  5. 2
      deps/uv/src/version.c

15
deps/uv/ChangeLog

@ -1,4 +1,17 @@
2013.05.25, Version 0.10.8 (Stable) 2013.05.29, Version 0.10.9 (Stable)
Changes since version 0.10.8:
* unix: fix stream refcounting buglet (Ben Noordhuis)
* unix: remove erroneous asserts (Ben Noordhuis)
* unix: add uv__is_closing() macro (Ben Noordhuis)
* unix: stop stream POLLOUT watcher on write error (Ben Noordhuis)
2013.05.25, Version 0.10.8 (Stable), 0f39be12926fe2d8766a9f025797a473003e6504
Changes since version 0.10.7: Changes since version 0.10.7:

9
deps/uv/src/unix/core.c

@ -162,7 +162,12 @@ void uv__make_close_pending(uv_handle_t* handle) {
static void uv__finish_close(uv_handle_t* handle) { static void uv__finish_close(uv_handle_t* handle) {
assert(!uv__is_active(handle)); /* Note: while the handle is in the UV_CLOSING state now, it's still possible
* for it to be active in the sense that uv__is_active() returns true.
* A good example is when the user calls uv_shutdown(), immediately followed
* by uv_close(). The handle is considered active at this point because the
* completion of the shutdown req is still pending.
*/
assert(handle->flags & UV_CLOSING); assert(handle->flags & UV_CLOSING);
assert(!(handle->flags & UV_CLOSED)); assert(!(handle->flags & UV_CLOSED));
handle->flags |= UV_CLOSED; handle->flags |= UV_CLOSED;
@ -220,7 +225,7 @@ static void uv__run_closing_handles(uv_loop_t* loop) {
int uv_is_closing(const uv_handle_t* handle) { int uv_is_closing(const uv_handle_t* handle) {
return handle->flags & (UV_CLOSING | UV_CLOSED); return uv__is_closing(handle);
} }

23
deps/uv/src/unix/stream.c

@ -429,6 +429,11 @@ void uv__stream_destroy(uv_stream_t* stream) {
} }
if (stream->shutdown_req) { if (stream->shutdown_req) {
/* The UV_ECANCELED error code is a lie, the shutdown(2) syscall is a
* fait accompli at this point. Maybe we should revisit this in v0.11.
* A possible reason for leaving it unchanged is that it informs the
* callee that the handle has been destroyed.
*/
uv__req_unregister(stream->loop, stream->shutdown_req); uv__req_unregister(stream->loop, stream->shutdown_req);
uv__set_artificial_error(stream->loop, UV_ECANCELED); uv__set_artificial_error(stream->loop, UV_ECANCELED);
stream->shutdown_req->cb(stream->shutdown_req, -1); stream->shutdown_req->cb(stream->shutdown_req, -1);
@ -627,8 +632,6 @@ static void uv__drain(uv_stream_t* stream) {
uv_shutdown_t* req; uv_shutdown_t* req;
assert(ngx_queue_empty(&stream->write_queue)); assert(ngx_queue_empty(&stream->write_queue));
assert(stream->write_queue_size == 0);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT); uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT);
/* Shutdown? */ /* Shutdown? */
@ -722,10 +725,8 @@ start:
assert(uv__stream_fd(stream) >= 0); assert(uv__stream_fd(stream) >= 0);
if (ngx_queue_empty(&stream->write_queue)) { if (ngx_queue_empty(&stream->write_queue))
assert(stream->write_queue_size == 0);
return; return;
}
q = ngx_queue_head(&stream->write_queue); q = ngx_queue_head(&stream->write_queue);
req = ngx_queue_data(q, uv_write_t, queue); req = ngx_queue_data(q, uv_write_t, queue);
@ -797,6 +798,9 @@ start:
/* Error */ /* Error */
req->error = errno; req->error = errno;
uv__write_req_finish(req); uv__write_req_finish(req);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT);
if (!uv__io_active(&stream->io_watcher, UV__POLLIN))
uv__handle_stop(stream);
return; return;
} else if (stream->flags & UV_STREAM_BLOCKING) { } else if (stream->flags & UV_STREAM_BLOCKING) {
/* If this is a blocking stream, try again. */ /* If this is a blocking stream, try again. */
@ -1200,6 +1204,12 @@ int uv_write2(uv_write_t* req,
return uv__set_artificial_error(stream->loop, UV_EBADF); return uv__set_artificial_error(stream->loop, UV_EBADF);
} }
/* It's legal for write_queue_size > 0 even when the write_queue is empty;
* it means there are error-state requests in the write_completed_queue that
* will touch up write_queue_size later, see also uv__write_req_finish().
* We chould check that write_queue is empty instead but that implies making
* a write() syscall when we know that the handle is in error mode.
*/
empty_queue = (stream->write_queue_size == 0); empty_queue = (stream->write_queue_size == 0);
/* Initialize the req */ /* Initialize the req */
@ -1318,9 +1328,10 @@ int uv_read_stop(uv_stream_t* stream) {
stream->shutdown_req != NULL || stream->shutdown_req != NULL ||
stream->connect_req != NULL); stream->connect_req != NULL);
stream->flags &= ~UV_STREAM_READING;
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN); uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
if (!uv__io_active(&stream->io_watcher, UV__POLLOUT))
uv__handle_stop(stream); uv__handle_stop(stream);
stream->flags &= ~UV_STREAM_READING;
#if defined(__APPLE__) #if defined(__APPLE__)
/* Notify select() thread about state change */ /* Notify select() thread about state change */

3
deps/uv/src/uv-common.h

@ -149,6 +149,9 @@ void uv__fs_poll_close(uv_fs_poll_t* handle);
#define uv__is_active(h) \ #define uv__is_active(h) \
(((h)->flags & UV__HANDLE_ACTIVE) != 0) (((h)->flags & UV__HANDLE_ACTIVE) != 0)
#define uv__is_closing(h) \
(((h)->flags & (UV_CLOSING | UV_CLOSED)) != 0)
#define uv__handle_start(h) \ #define uv__handle_start(h) \
do { \ do { \
assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \ assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \

2
deps/uv/src/version.c

@ -34,7 +34,7 @@
#define UV_VERSION_MAJOR 0 #define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10 #define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 8 #define UV_VERSION_PATCH 9
#define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_IS_RELEASE 1

Loading…
Cancel
Save