Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'v0.6.11-release' into v0.6

  • Loading branch information...
isaacs committed Feb 17, 2012
2 parents 9764bea + f73f07e commit dfed2cef7533de43544625fe27a31f65654d7bc6
@@ -261,3 +261,8 @@ Brandon Benvie <brandon@bbenvie.com>
Nicolas LaCasse <nlacasse@borderstylo.com>
Dan VerWeire <dverweire@gmail.com>
Matthew Fitzsimmons <matt@joyent.com>
Paddy Byers <paddy.byers@gmail.com>
Philip Tellis <philip.tellis@gmail.com>
Christopher Jeffrey <chjjeffrey@gmail.com>
Seth Fitzsimmons <seth@mojodna.net>
Einar Otto Stangvik <einaros@gmail.com>
@@ -1,4 +1,44 @@
2012.02.02, Version 0.6.10 (stable)
2012.02.17 Version 0.6.11 (stable)

* http: allow multiple WebSocket RFC6455 headers (Einar Otto Stangvik)

* http: allow multiple WWW-Authenticate headers (Ben Noordhuis)

* windows: support unicode argv and environment variables (Bert Belder)

* tls: mitigate session renegotiation attacks (Ben Noordhuis)

* tcp, pipe: don't assert on uv_accept() errors (Ben Noordhuis)

* tls: Allow establishing secure connection on the existing socket (koichik)

* dgram: handle close of dgram socket before DNS lookup completes (Seth Fitzsimmons)

* windows: Support half-duplex pipes (Igor Zinkovsky)

* build: disable omit-frame-pointer on solaris systems (Dave Pacheco)

* debugger: fix --debug-brk (Ben Noordhuis)

* net: fix large file downloads failing (koichik)

* fs: fix ReadStream failure to read from existing fd (Christopher Jeffrey)

* net: destroy socket on DNS error (Stefan Rusu)

* dtrace: add missing translator (Dave Pacheco)

* unix: don't flush tty on switch to raw mode (Ben Noordhuis)

* windows: reset brightness when reverting to default text color (Bert Belder)

* npm: update to 1.1.1
- Update which, fstream, mkdirp, request, and rimraf
- Fix #2123 Set path properly for lifecycle scripts on windows
- Mark the root as seen, so we don't recurse into it. Fixes #1838. (Martin Cooper)


2012.02.02, Version 0.6.10 (stable), 051908e023f87894fa68f5b64d0b99a19a7db01e

* Update V8 to 3.6.6.20

@@ -173,8 +173,8 @@ pkg: $(PKG)

$(PKG):
-rm -rf $(PKGDIR)
$(WAF) configure --prefix=/usr/local --without-snapshot
DESTDIR=$(PKGDIR) $(WAF) install
$(WAF) configure --prefix=/usr/local --without-snapshot --dest-cpu=ia32
CFLAGS=-m32 DESTDIR=$(PKGDIR) $(WAF) install
$(packagemaker) \
--id "org.nodejs.NodeJS-$(VERSION)" \
--doc tools/osx-pkg.pmdoc \
@@ -388,7 +388,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
#define UV_FS_PRIVATE_FIELDS \
wchar_t* pathw; \
int flags; \
int last_error; \
DWORD sys_errno_; \
struct _stati64 stat; \
void* arg0; \
union { \
@@ -76,8 +76,8 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
raw.c_cc[VMIN] = 1;
raw.c_cc[VTIME] = 0;

/* Put terminal in raw mode after flushing */
if (tcsetattr(fd, TCSAFLUSH, &raw)) {
/* Put terminal in raw mode after draining */
if (tcsetattr(fd, TCSADRAIN, &raw)) {
goto fatal;
}

@@ -84,6 +84,8 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case WSAECONNREFUSED: return UV_ECONNREFUSED;
case ERROR_NETNAME_DELETED: return UV_ECONNRESET;
case WSAECONNRESET: return UV_ECONNRESET;
case ERROR_ALREADY_EXISTS: return UV_EEXIST;
case ERROR_FILE_EXISTS: return UV_EEXIST;
case WSAEFAULT: return UV_EFAULT;
case ERROR_HOST_UNREACHABLE: return UV_EHOSTUNREACH;
case WSAEHOSTUNREACH: return UV_EHOSTUNREACH;
@@ -93,6 +95,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE;
case WSAEMFILE: return UV_EMFILE;
case WSAEMSGSIZE: return UV_EMSGSIZE;
case ERROR_FILENAME_EXCED_RANGE: return UV_ENAMETOOLONG;
case ERROR_NETWORK_UNREACHABLE: return UV_ENETUNREACH;
case WSAENETUNREACH: return UV_ENETUNREACH;
case WSAENOBUFS: return UV_ENOBUFS;
@@ -105,9 +108,12 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_INVALID_PARAMETER: return UV_EINVAL;
case ERROR_NO_UNICODE_TRANSLATION: return UV_ECHARSET;
case ERROR_BROKEN_PIPE: return UV_EOF;
case ERROR_BAD_PIPE: return UV_EPIPE;
case ERROR_NO_DATA: return UV_EPIPE;
case ERROR_PIPE_NOT_CONNECTED: return UV_EPIPE;
case ERROR_PIPE_BUSY: return UV_EBUSY;
case ERROR_SEM_TIMEOUT: return UV_ETIMEDOUT;
case ERROR_ALREADY_EXISTS: return UV_EEXIST;
case WSAETIMEDOUT: return UV_ETIMEDOUT;
case WSAHOST_NOT_FOUND: return UV_ENOENT;
default: return UV_UNKNOWN;
}
@@ -38,7 +38,6 @@
#define UV_FS_FREE_ARG1 0x0004
#define UV_FS_FREE_PTR 0x0008
#define UV_FS_CLEANEDUP 0x0010
#define UV_FS_LAST_ERROR_SET 0x0020


#define UTF8_TO_UTF16(s, t) \
@@ -88,33 +87,30 @@
uv_ref((loop));

#define SET_UV_LAST_ERROR_FROM_REQ(req) \
if (req->flags & UV_FS_LAST_ERROR_SET) { \
uv__set_sys_error(req->loop, req->last_error); \
} else if (req->result == -1) { \
uv__set_error(req->loop, (uv_err_code)req->errorno, req->last_error); \
}

#define SET_REQ_LAST_ERROR(req, error) \
req->last_error = error; \
req->flags |= UV_FS_LAST_ERROR_SET;
uv__set_error(req->loop, req->errorno, req->sys_errno_);

#define SET_REQ_RESULT(req, result_value) \
req->result = (result_value); \
if (req->result == -1) { \
req->last_error = _doserrno; \
req->errorno = uv_translate_sys_error(req->last_error); \
req->sys_errno_ = _doserrno; \
req->errorno = uv_translate_sys_error(req->sys_errno_); \
}

#define SET_REQ_RESULT_WIN32_ERROR(req, sys_errno) \
#define SET_REQ_WIN32_ERROR(req, sys_errno) \
req->result = -1; \
req->sys_errno_ = (sys_errno); \
req->errorno = uv_translate_sys_error(req->sys_errno_);

#define SET_REQ_UV_ERROR(req, uv_errno, sys_errno) \
req->result = -1; \
req->errorno = uv_translate_sys_error(sys_errno); \
SET_REQ_LAST_ERROR(req, sys_errno);
req->sys_errno_ = (sys_errno); \
req->errorno = (uv_errno);

#define VERIFY_UV_FILE(file, req) \
if (file == -1) { \
req->result = -1; \
req->errorno = UV_EBADF; \
req->last_error = ERROR_SUCCESS; \
req->sys_errno_ = ERROR_SUCCESS; \
return; \
}

@@ -137,7 +133,7 @@ static void uv_fs_req_init_async(uv_loop_t* loop, uv_fs_t* req,
req->path = path ? strdup(path) : NULL;
req->pathw = (wchar_t*)pathw;
req->errorno = 0;
req->last_error = 0;
req->sys_errno_ = 0;
memset(&req->overlapped, 0, sizeof(req->overlapped));
}

@@ -266,7 +262,15 @@ void fs__open(uv_fs_t* req, const wchar_t* path, int flags, int mode) {
attributes,
NULL);
if (file == INVALID_HANDLE_VALUE) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
DWORD error = GetLastError();
if (error == ERROR_FILE_EXISTS && (flags & _O_CREAT) &&
!(flags & _O_EXCL)) {
/* Special case: when ERROR_FILE_EXISTS happens and O_CREAT was */
/* specified, it means the path referred to a directory. */
SET_REQ_UV_ERROR(req, UV_EISDIR, error);
} else {
SET_REQ_WIN32_ERROR(req, GetLastError());
}
return;
}
result = _open_osfhandle((intptr_t)file, flags);
@@ -300,7 +304,7 @@ void fs__read(uv_fs_t* req, uv_file file, void *buf, size_t length,
}

if (length > INT_MAX) {
SET_REQ_ERROR(req, ERROR_INSUFFICIENT_BUFFER);
SET_REQ_WIN32_ERROR(req, ERROR_INSUFFICIENT_BUFFER);
return;
}

@@ -319,7 +323,7 @@ void fs__read(uv_fs_t* req, uv_file file, void *buf, size_t length,
if (ReadFile(handle, buf, length, &bytes, overlapped_ptr)) {
SET_REQ_RESULT(req, bytes);
} else {
SET_REQ_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
}
}

@@ -340,7 +344,7 @@ void fs__write(uv_fs_t* req, uv_file file, void *buf, size_t length,
}

if (length > INT_MAX) {
SET_REQ_ERROR(req, ERROR_INSUFFICIENT_BUFFER);
SET_REQ_WIN32_ERROR(req, ERROR_INSUFFICIENT_BUFFER);
return;
}

@@ -359,7 +363,7 @@ void fs__write(uv_fs_t* req, uv_file file, void *buf, size_t length,
if (WriteFile(handle, buf, length, &bytes, overlapped_ptr)) {
SET_REQ_RESULT(req, bytes);
} else {
SET_REQ_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
}
}

@@ -398,7 +402,7 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {
if (!(GetFileAttributesW(path) & FILE_ATTRIBUTE_DIRECTORY)) {
req->result = -1;
req->errorno = UV_ENOTDIR;
req->last_error = ERROR_SUCCESS;
req->sys_errno_ = ERROR_SUCCESS;
return;
}

@@ -416,7 +420,7 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {
free(path2);

if(dir == INVALID_HANDLE_VALUE) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}

@@ -460,7 +464,7 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {
/* Convert result to UTF8. */
size = uv_utf16_to_utf8(buf, buf_char_len, NULL, 0);
if (!size) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}

@@ -474,7 +478,7 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {
free(buf);
free(req->ptr);
req->ptr = NULL;
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}
free(buf);
@@ -491,7 +495,6 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {

static void fs__stat(uv_fs_t* req, const wchar_t* path) {
HANDLE handle;
int result;
BY_HANDLE_FILE_INFORMATION info;

req->ptr = NULL;
@@ -504,12 +507,12 @@ static void fs__stat(uv_fs_t* req, const wchar_t* path) {
FILE_FLAG_BACKUP_SEMANTICS,
NULL);
if (handle == INVALID_HANDLE_VALUE) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}

if (!GetFileInformationByHandle(handle, &info)) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
CloseHandle(handle);
return;
}
@@ -565,7 +568,7 @@ void fs__fstat(uv_fs_t* req, uv_file file) {

void fs__rename(uv_fs_t* req, const wchar_t* path, const wchar_t* new_path) {
if (!MoveFileExW(path, new_path, MOVEFILE_REPLACE_EXISTING)) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}

@@ -580,7 +583,7 @@ void fs__fsync(uv_fs_t* req, uv_file file) {

result = FlushFileBuffers((HANDLE)_get_osfhandle(file)) ? 0 : -1;
if (result == -1) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
} else {
SET_REQ_RESULT(req, result);
}
@@ -711,7 +714,7 @@ void fs__futime(uv_fs_t* req, uv_file file, double atime, double mtime) {
void fs__link(uv_fs_t* req, const wchar_t* path, const wchar_t* new_path) {
int result = CreateHardLinkW(new_path, path, NULL) ? 0 : -1;
if (result == -1) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
} else {
SET_REQ_RESULT(req, result);
}
@@ -726,13 +729,11 @@ void fs__symlink(uv_fs_t* req, const wchar_t* path, const wchar_t* new_path,
path,
flags & UV_FS_SYMLINK_DIR ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) ? 0 : -1;
if (result == -1) {
SET_REQ_RESULT_WIN32_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}
} else {
req->result = -1;
req->errorno = UV_ENOTSUP;
req->last_error = ERROR_SUCCESS;
SET_REQ_UV_ERROR(req, UV_ENOSYS, ERROR_NOT_SUPPORTED);
return;
}

@@ -761,7 +762,7 @@ void fs__readlink(uv_fs_t* req, const wchar_t* path) {

if (INVALID_HANDLE_VALUE == symlink) {
result = -1;
SET_REQ_LAST_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
goto done;
}

@@ -781,15 +782,15 @@ void fs__readlink(uv_fs_t* req, const wchar_t* path) {

if (!rv) {
result = -1;
SET_REQ_LAST_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
goto done;
}

reparse_data = (REPARSE_DATA_BUFFER*)buffer;
if (reparse_data->ReparseTag != IO_REPARSE_TAG_SYMLINK) {
result = -1;
/* something is seriously wrong */
SET_REQ_LAST_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
goto done;
}

@@ -810,7 +811,7 @@ void fs__readlink(uv_fs_t* req, const wchar_t* path) {
0);
if (!utf8size) {
result = -1;
SET_REQ_LAST_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
goto done;
}

@@ -825,7 +826,7 @@ void fs__readlink(uv_fs_t* req, const wchar_t* path) {
utf8size);
if (!utf8size) {
result = -1;
SET_REQ_LAST_ERROR(req, GetLastError());
SET_REQ_WIN32_ERROR(req, GetLastError());
goto done;
}

@@ -45,7 +45,7 @@
# define close _close
#endif

#define TOO_LONG_NAME_LENGTH 8192
#define TOO_LONG_NAME_LENGTH 65536

typedef struct {
const char* path;
@@ -130,7 +130,7 @@ <h1>Node's goal is to provide an easy way to build scalable
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>

<p>Copyright 2010 <a href="http://joyent.com">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.6.10/LICENSE">license</a>.</p>
<p>Copyright 2010 <a href="http://joyent.com">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.6.11/LICENSE">license</a>.</p>
</div>


0 comments on commit dfed2ce

Please sign in to comment.
You can’t perform that action at this time.