view release on metacpan or search on metacpan
libuv/ChangeLog view on Meta::CPAN
* win: fix replacing pipe handle for pipe servers (Saúl Ibarra Corretgé)
* win: fix setting pipe pending instances after bind (Saúl Ibarra Corretgé)
2015.08.20, Version 1.7.1 (Stable), 44f4b6bd82d8ae4583ccc4768a83af778ef69f85
Changes since version 1.7.0:
* doc: document the procedure for verifying releases (Saúl Ibarra Corretgé)
* doc: add note about Windows binaries to the README (Saúl Ibarra Corretgé)
* doc: use long GPG IDs in MAINTAINERS.md (Saúl Ibarra Corretgé)
* Revert "stream: squelch ECONNRESET error if already closed" (Saúl Ibarra
Corretgé)
* doc: clarify uv_read_stop() is idempotent (Corbin Simpson)
libuv/ChangeLog view on Meta::CPAN
* unix, windows: move uv_now() to uv-common.c (Ben Noordhuis)
* test: fix a compilation problem in test-osx-select.c that was caused by the
use of c-style comments (Bert Belder)
* darwin: use uv_fs_sendfile() use the sendfile api correctly (Wynn Wilkes)
* windows: call idle handles on every loop iteration, something the unix
implementation already did (Bert Belder)
* test: update the idle-starvation test to verify that idle handles are called
in every loop iteration (Bert Belder)
* unix, windows: ensure that uv_run() in RUN_ONCE mode calls timers that expire
after blocking (Ben Noordhuis)
2013.05.29, Version 0.10.9 (Stable), a195f9ace23d92345baf57582678bfc3017e6632
Changes since version 0.10.8:
libuv/README.md view on Meta::CPAN
### Other resources
* [LXJS 2012 talk](http://www.youtube.com/watch?v=nGn60vDSxQ4)
— High-level introductory talk about libuv.
* [libuv-dox](https://github.com/thlorenz/libuv-dox)
— Documenting types and methods of libuv, mostly by reading uv.h.
* [learnuv](https://github.com/thlorenz/learnuv)
— Learn uv for fun and profit, a self guided workshop to libuv.
These resources are not handled by libuv maintainers and might be out of
date. Please verify it before opening new issues.
## Downloading
libuv can be downloaded either from the
[GitHub repository](https://github.com/libuv/libuv)
or from the [downloads site](http://dist.libuv.org/dist/).
Starting with libuv 1.7.0, binaries for Windows are also provided. This is to
be considered EXPERIMENTAL.
Before verifying the git tags or signature files, importing the relevant keys
is necessary. Key IDs are listed in the
[MAINTAINERS](https://github.com/libuv/libuv/blob/master/MAINTAINERS.md)
file, but are also available as git blob objects for easier use.
Importing a key the usual way:
```bash
$ gpg --keyserver pool.sks-keyservers.net --recv-keys AE9BC059
```
libuv/README.md view on Meta::CPAN
```bash
$ git show pubkey-saghul | gpg --import
```
### Verifying releases
Git tags are signed with the developer's key, they can be verified as follows:
```bash
$ git verify-tag v1.6.1
```
Starting with libuv 1.7.0, the tarballs stored in the
[downloads site](http://dist.libuv.org/dist/) are signed and an accompanying
signature file sit alongside each. Once both the release tarball and the
signature file are downloaded, the file can be verified as follows:
```bash
$ gpg --verify libuv-1.7.0.tar.gz.sign
```
## Build Instructions
For GCC there are two build methods: via autotools or via [GYP][].
GYP is a meta-build system which can generate MSVS, Makefile, and XCode
backends. It is best used for integration into other projects.
To build with autotools:
libuv/samples/socks5-proxy/s5.c view on Meta::CPAN
break;
case s5_auth_pw_password:
if (cx->arg0 < cx->passlen) {
cx->password[cx->arg0] = c;
cx->arg0 += 1;
}
if (cx->arg0 == cx->passlen) {
cx->password[cx->passlen] = '\0';
cx->state = s5_req_version;
err = s5_auth_verify;
goto out;
}
break;
case s5_req_version:
if (c != 5) {
err = s5_bad_version;
goto out;
}
cx->state = s5_req_cmd;
libuv/samples/socks5-proxy/s5.h view on Meta::CPAN
#include <stddef.h>
#include <stdint.h>
#define S5_ERR_MAP(V) \
V(-1, bad_version, "Bad protocol version.") \
V(-2, bad_cmd, "Bad protocol command.") \
V(-3, bad_atyp, "Bad address type.") \
V(0, ok, "No error.") \
V(1, auth_select, "Select authentication method.") \
V(2, auth_verify, "Verify authentication.") \
V(3, exec_cmd, "Execute command.") \
typedef enum {
#define S5_ERR_GEN(code, name, _) s5_ ## name = code,
S5_ERR_MAP(S5_ERR_GEN)
#undef S5_ERR_GEN
s5_max_errors
} s5_err;
typedef enum {
libuv/src/win/internal.h view on Meta::CPAN
/*
* Process stdio handles.
*/
int uv__stdio_create(uv_loop_t* loop,
const uv_process_options_t* options,
BYTE** buffer_ptr);
void uv__stdio_destroy(BYTE* buffer);
void uv__stdio_noinherit(BYTE* buffer);
int uv__stdio_verify(BYTE* buffer, WORD size);
WORD uv__stdio_size(BYTE* buffer);
HANDLE uv__stdio_handle(BYTE* buffer, int fd);
/*
* Winapi and ntapi utility functions
*/
void uv_winapi_init(void);
libuv/src/win/process-stdio.c view on Meta::CPAN
handle = GetStdHandle(STD_OUTPUT_HANDLE);
if (handle != NULL && handle != INVALID_HANDLE_VALUE)
SetHandleInformation(handle, HANDLE_FLAG_INHERIT, 0);
handle = GetStdHandle(STD_ERROR_HANDLE);
if (handle != NULL && handle != INVALID_HANDLE_VALUE)
SetHandleInformation(handle, HANDLE_FLAG_INHERIT, 0);
/* Make inherited CRT FDs non-inheritable. */
GetStartupInfoW(&si);
if (uv__stdio_verify(si.lpReserved2, si.cbReserved2))
uv__stdio_noinherit(si.lpReserved2);
}
static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
uv_pipe_t* server_pipe, HANDLE* child_pipe_ptr, unsigned int flags) {
char pipe_name[64];
SECURITY_ATTRIBUTES sa;
DWORD server_access = 0;
DWORD client_access = 0;
libuv/src/win/process-stdio.c view on Meta::CPAN
count = CHILD_STDIO_COUNT(buffer);
for (i = 0; i < count; i++) {
HANDLE handle = CHILD_STDIO_HANDLE(buffer, i);
if (handle != INVALID_HANDLE_VALUE) {
SetHandleInformation(handle, HANDLE_FLAG_INHERIT, 0);
}
}
}
int uv__stdio_verify(BYTE* buffer, WORD size) {
unsigned int count;
/* Check the buffer pointer. */
if (buffer == NULL)
return 0;
/* Verify that the buffer is at least big enough to hold the count. */
if (size < CHILD_STDIO_SIZE(0))
return 0;
libuv/test/test-async-null-cb.c view on Meta::CPAN
uv_close((uv_handle_t*) &check_handle, NULL);
check_cb_called++;
}
TEST_IMPL(async_null_cb) {
/*
* Fill async_handle with garbage values.
* uv_async_init() should properly initialize struct fields regardless of
* initial values.
* This is added to verify paddings between fields do not affect behavior.
*/
memset(&async_handle, 0xff, sizeof(async_handle));
ASSERT(0 == uv_async_init(uv_default_loop(), &async_handle, NULL));
ASSERT(0 == uv_check_init(uv_default_loop(), &check_handle));
ASSERT(0 == uv_check_start(&check_handle, check_cb));
ASSERT(0 == uv_thread_create(&thread, thread_cb, NULL));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
ASSERT(0 == uv_thread_join(&thread));
ASSERT(1 == check_cb_called);
libuv/test/test-fs-event.c view on Meta::CPAN
/* Setup */
loop = uv_default_loop();
remove("watch_dir/file1");
remove("watch_dir/");
create_dir("watch_dir");
create_file("watch_dir/file1");
/* Newer version of Windows ship with
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation
not equal to 0. So we verify the files we created are addressable by a 8.3
short name */
has_shortnames = uv_fs_stat(NULL, &req, "watch_~1", NULL) != UV_ENOENT;
if (has_shortnames) {
r = uv_fs_event_init(loop, &fs_event);
ASSERT(r == 0);
r = uv_fs_event_start(&fs_event, fs_event_cb_dir, "watch_~1", 0);
ASSERT(r == 0);
r = uv_timer_init(loop, &timer);
ASSERT(r == 0);
r = uv_timer_start(&timer, timer_cb_file, 100, 0);
libuv/test/test-fs.c view on Meta::CPAN
uv_fs_req_cleanup(&req);
*/
r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL);
ASSERT(r == 1);
ASSERT(scandir_req.result == 1);
ASSERT(scandir_req.ptr);
while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) {
ASSERT(strcmp(dent.name, "test_file") == 0);
/* uv_fs_scandir incorrectly identifies non-symlink reparse points
as links because it doesn't open the file and verify the reparse
point tag. The PowerShell Get-ChildItem command shares this
behavior, so it's reasonable to leave it as is. */
ASSERT(dent.type == UV_DIRENT_LINK);
}
uv_fs_req_cleanup(&scandir_req);
ASSERT(!scandir_req.ptr);
/* clean-up */
unlink("test_dir/test_file");
rmdir("test_dir");
libuv/test/test-poll-close-doesnt-corrupt-stack.c view on Meta::CPAN
static void close_cb(uv_handle_t* h) {
close_cb_called++;
}
static void poll_cb(uv_poll_t* h, int status, int events) {
ASSERT(0 && "should never get here");
}
static void NO_INLINE close_socket_and_verify_stack(void) {
const uint32_t MARKER = 0xDEADBEEF;
const int VERIFY_AFTER = 10; /* ms */
int r;
volatile uint32_t data[65536];
size_t i;
for (i = 0; i < ARRAY_SIZE(data); i++)
data[i] = MARKER;
libuv/test/test-poll-close-doesnt-corrupt-stack.c view on Meta::CPAN
ASSERT(r != 0);
ASSERT(WSAGetLastError() == WSAEWOULDBLOCK);
r = uv_poll_init_socket(uv_default_loop(), &handle, sock);
ASSERT(r == 0);
r = uv_poll_start(&handle, UV_READABLE | UV_WRITABLE, poll_cb);
ASSERT(r == 0);
uv_close((uv_handle_t*) &handle, close_cb);
close_socket_and_verify_stack();
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();
return 0;
#endif
}
libuv/test/test-shutdown-close.c view on Meta::CPAN
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/*
* These tests verify that the uv_shutdown callback is always made, even when
* it is immediately followed by an uv_close call.
*/
#include "uv.h"
#include "task.h"
static uv_shutdown_t shutdown_req;
static uv_connect_t connect_req;
libuv/test/test-spawn.c view on Meta::CPAN
int err;
init_process_options("", fail_cb);
options.file = options.args[0] = "program-that-had-better-not-exist";
r = uv_spawn(uv_default_loop(), &process, &options);
ASSERT(r == UV_ENOENT || r == UV_EACCES);
ASSERT(0 == uv_is_active((uv_handle_t*) &process));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
/* verify the child is successfully cleaned up within libuv */
do
err = waitpid(process.pid, &status, 0);
while (err == -1 && errno == EINTR);
ASSERT(err == -1);
ASSERT(errno == ECHILD);
uv_close((uv_handle_t*) &process, NULL);
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
libuv/test/test-spawn.c view on Meta::CPAN
found = 1;
}
}
for (i = 0; i < ARRAY_SIZE(expected) && !found; i++) {
if (!wcscmp(str, expected[i])) {
ASSERT(!found_in_usr_env[i]);
found_in_usr_env[i] = 1;
found = 1;
}
}
if (prev) { /* verify sort order -- requires Vista */
#if _WIN32_WINNT >= 0x0600 && \
(!defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR))
ASSERT(CompareStringOrdinal(prev, -1, str, -1, TRUE) == 1);
#endif
}
ASSERT(found); /* verify that we expected this variable */
}
/* verify that we found all expected variables */
for (i = 0; i < ARRAY_SIZE(wenvironment); i++) {
ASSERT(found_in_loc_env[i]);
}
for (i = 0; i < ARRAY_SIZE(expected); i++) {
ASSERT(found_in_usr_env[i]);
}
return 0;
}
#endif
libuv/test/test-thread.c view on Meta::CPAN
r = uv_thread_join(&tid);
ASSERT(r == 0);
ASSERT(thread_called == 1);
return 0;
}
/* Hilariously bad test name. Run a lot of tasks in the thread pool and verify
* that each "finished" callback is run in its originating thread.
*/
TEST_IMPL(threadpool_multiple_event_loops) {
struct test_thread threads[8];
size_t i;
int r;
memset(threads, 0, sizeof(threads));
for (i = 0; i < ARRAY_SIZE(threads); i++) {