Skip to content

Commit

Permalink
uv: upgrade to v0.11.12
Browse files Browse the repository at this point in the history
* upgrade deps/uv/ to v0.11.12.
* update files in src/ after a libuv API change.
  • Loading branch information
bnoordhuis committed Sep 2, 2013
1 parent 185c515 commit ed8d97f
Show file tree
Hide file tree
Showing 78 changed files with 1,407 additions and 1,198 deletions.
35 changes: 34 additions & 1 deletion deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
2013.08.30, Version 0.11.11 (Unstable)
2013.09.03, Version 0.11.12 (Unstable)

Changes since version 0.11.11:

* test: fix epoll_wait() usage in test-embed.c (Ben Noordhuis)

* include: uv_alloc_cb now takes uv_buf_t* (Ben Noordhuis)

* include: uv_read{2}_cb now takes const uv_buf_t* (Ben Noordhuis)

* include: uv_ip[46]_addr now takes sockaddr_in* (Ben Noordhuis)

* include: uv_tcp_bind{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_tcp_connect{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_udp_recv_cb now takes const uv_buf_t* (Ben Noordhuis)

* include: uv_udp_bind{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_udp_send{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_spawn takes const uv_process_options_t* (Ben Noordhuis)

* include: make uv_write{2} const correct (Ben Noordhuis)

* windows: fix flags assignment in uv_fs_readdir() (Ben Noordhuis)

* windows: fix stray comments (Ben Noordhuis)

* windows: remove unused is_path_dir() function (Ben Noordhuis)


2013.08.30, Version 0.11.11 (Unstable), ba876d53539ed0427c52039012419cd9374c6f0d

Changes since version 0.11.10:

Expand Down
6 changes: 3 additions & 3 deletions deps/uv/include/uv-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ typedef struct {

#define UV_WRITE_PRIVATE_FIELDS \
void* queue[2]; \
int write_index; \
unsigned int write_index; \
uv_buf_t* bufs; \
int bufcnt; \
unsigned int nbufs; \
int error; \
uv_buf_t bufsml[4]; \

Expand All @@ -213,7 +213,7 @@ typedef struct {
#define UV_UDP_SEND_PRIVATE_FIELDS \
void* queue[2]; \
struct sockaddr_in6 addr; \
int bufcnt; \
unsigned int nbufs; \
uv_buf_t* bufs; \
ssize_t status; \
uv_udp_send_cb send_cb; \
Expand Down
101 changes: 66 additions & 35 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ UV_EXTERN int uv_backend_timeout(const uv_loop_t*);


/*
* Should return a buffer that libuv can use to read data into.
* Should prepare a buffer that libuv can use to read data into.
*
* `suggested_size` is a hint. Returning a buffer that is smaller is perfectly
* okay as long as `buf.len > 0`.
Expand All @@ -349,7 +349,9 @@ UV_EXTERN int uv_backend_timeout(const uv_loop_t*);
* Note that returning a zero-length buffer does not stop the handle, call
* uv_read_stop() or uv_udp_recv_stop() for that.
*/
typedef uv_buf_t (*uv_alloc_cb)(uv_handle_t* handle, size_t suggested_size);
typedef void (*uv_alloc_cb)(uv_handle_t* handle,
size_t suggested_size,
uv_buf_t* buf);

/*
* `nread` is > 0 if there is data available, 0 if libuv is done reading for
Expand All @@ -359,18 +361,22 @@ typedef uv_buf_t (*uv_alloc_cb)(uv_handle_t* handle, size_t suggested_size);
* Trying to read from the stream again is undefined.
*
* The callee is responsible for freeing the buffer, libuv does not reuse it.
* The buffer may be a null buffer (where buf.base=NULL and buf.len=0) on EOF
* or error.
* The buffer may be a null buffer (where buf->base=NULL and buf->len=0) on
* EOF or error.
*/
typedef void (*uv_read_cb)(uv_stream_t* stream, ssize_t nread, uv_buf_t buf);
typedef void (*uv_read_cb)(uv_stream_t* stream,
ssize_t nread,
const uv_buf_t* buf);

/*
* Just like the uv_read_cb except that if the pending parameter is true
* then you can use uv_accept() to pull the new handle into the process.
* If no handle is pending then pending will be UV_UNKNOWN_HANDLE.
*/
typedef void (*uv_read2_cb)(uv_pipe_t* pipe, ssize_t nread, uv_buf_t buf,
uv_handle_type pending);
typedef void (*uv_read2_cb)(uv_pipe_t* pipe,
ssize_t nread,
const uv_buf_t* buf,
uv_handle_type pending);

typedef void (*uv_write_cb)(uv_write_t* req, int status);
typedef void (*uv_connect_cb)(uv_connect_t* req, int status);
Expand Down Expand Up @@ -648,8 +654,11 @@ UV_EXTERN int uv_read2_start(uv_stream_t*, uv_alloc_cb alloc_cb,
* uv_write(&req2, stream, b, 2);
*
*/
UV_EXTERN int uv_write(uv_write_t* req, uv_stream_t* handle,
uv_buf_t bufs[], int bufcnt, uv_write_cb cb);
UV_EXTERN int uv_write(uv_write_t* req,
uv_stream_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
uv_write_cb cb);

/*
* Extended write function for sending handles over a pipe. The pipe must be
Expand All @@ -658,8 +667,12 @@ UV_EXTERN int uv_write(uv_write_t* req, uv_stream_t* handle,
* (listening or connected state). Bound sockets or pipes will be assumed to
* be servers.
*/
UV_EXTERN int uv_write2(uv_write_t* req, uv_stream_t* handle, uv_buf_t bufs[],
int bufcnt, uv_stream_t* send_handle, uv_write_cb cb);
UV_EXTERN int uv_write2(uv_write_t* req,
uv_stream_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
uv_stream_t* send_handle,
uv_write_cb cb);

/* uv_write_t is a subclass of uv_req_t */
struct uv_write_s {
Expand Down Expand Up @@ -753,8 +766,9 @@ UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
*/
UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);

UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle, struct sockaddr_in);
UV_EXTERN int uv_tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6);
UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle, const struct sockaddr_in* addr);
UV_EXTERN int uv_tcp_bind6(uv_tcp_t* handle, const struct sockaddr_in6* addr);

UV_EXTERN int uv_tcp_getsockname(uv_tcp_t* handle, struct sockaddr* name,
int* namelen);
UV_EXTERN int uv_tcp_getpeername(uv_tcp_t* handle, struct sockaddr* name,
Expand All @@ -766,10 +780,15 @@ UV_EXTERN int uv_tcp_getpeername(uv_tcp_t* handle, struct sockaddr* name,
* initialized TCP handle and an uninitialized uv_connect_t*. The callback
* will be made when the connection is established.
*/
UV_EXTERN int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
struct sockaddr_in address, uv_connect_cb cb);
UV_EXTERN int uv_tcp_connect6(uv_connect_t* req, uv_tcp_t* handle,
struct sockaddr_in6 address, uv_connect_cb cb);
UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
uv_tcp_t* handle,
const struct sockaddr_in* addr,
uv_connect_cb cb);

UV_EXTERN int uv_tcp_connect6(uv_connect_t* req,
uv_tcp_t* handle,
const struct sockaddr_in6* addr,
uv_connect_cb cb);

/* uv_connect_t is a subclass of uv_req_t */
struct uv_connect_s {
Expand Down Expand Up @@ -814,8 +833,11 @@ typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
* flags One or more OR'ed UV_UDP_* constants.
* Right now only UV_UDP_PARTIAL is used.
*/
typedef void (*uv_udp_recv_cb)(uv_udp_t* handle, ssize_t nread, uv_buf_t buf,
struct sockaddr* addr, unsigned flags);
typedef void (*uv_udp_recv_cb)(uv_udp_t* handle,
ssize_t nread,
const uv_buf_t* buf,
const struct sockaddr* addr,
unsigned flags);

/* uv_udp_t is a subclass of uv_handle_t */
struct uv_udp_s {
Expand Down Expand Up @@ -875,8 +897,9 @@ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
* This behavior is something of an anomaly and may be replaced by an explicit
* opt-in mechanism in future versions of libuv.
*/
UV_EXTERN int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr,
unsigned flags);
UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
const struct sockaddr_in* addr,
unsigned flags);

/*
* Bind to a IPv6 address and port.
Expand All @@ -889,8 +912,9 @@ UV_EXTERN int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr,
* Returns:
* 0 on success, or an error code < 0 on failure.
*/
UV_EXTERN int uv_udp_bind6(uv_udp_t* handle, struct sockaddr_in6 addr,
unsigned flags);
UV_EXTERN int uv_udp_bind6(uv_udp_t* handle,
const struct sockaddr_in6* addr,
unsigned flags);

UV_EXTERN int uv_udp_getsockname(uv_udp_t* handle, struct sockaddr* name,
int* namelen);
Expand Down Expand Up @@ -974,16 +998,19 @@ UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl);
* req UDP request handle. Need not be initialized.
* handle UDP handle. Should have been initialized with `uv_udp_init`.
* bufs List of buffers to send.
* bufcnt Number of buffers in `bufs`.
* nbufs Number of buffers in `bufs`.
* addr Address of the remote peer. See `uv_ip4_addr`.
* send_cb Callback to invoke when the data has been sent out.
*
* Returns:
* 0 on success, or an error code < 0 on failure.
*/
UV_EXTERN int uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle,
uv_buf_t bufs[], int bufcnt, struct sockaddr_in addr,
uv_udp_send_cb send_cb);
UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
uv_udp_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
const struct sockaddr_in* addr,
uv_udp_send_cb send_cb);

/*
* Send data. If the socket has not previously been bound with `uv_udp_bind6`,
Expand All @@ -993,16 +1020,19 @@ UV_EXTERN int uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle,
* req UDP request handle. Need not be initialized.
* handle UDP handle. Should have been initialized with `uv_udp_init`.
* bufs List of buffers to send.
* bufcnt Number of buffers in `bufs`.
* nbufs Number of buffers in `bufs`.
* addr Address of the remote peer. See `uv_ip6_addr`.
* send_cb Callback to invoke when the data has been sent out.
*
* Returns:
* 0 on success, or an error code < 0 on failure.
*/
UV_EXTERN int uv_udp_send6(uv_udp_send_t* req, uv_udp_t* handle,
uv_buf_t bufs[], int bufcnt, struct sockaddr_in6 addr,
uv_udp_send_cb send_cb);
UV_EXTERN int uv_udp_send6(uv_udp_send_t* req,
uv_udp_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
const struct sockaddr_in6* addr,
uv_udp_send_cb send_cb);

/*
* Receive data. If the socket has not previously been bound with `uv_udp_bind`
Expand Down Expand Up @@ -1479,8 +1509,9 @@ struct uv_process_s {
};

/* Initializes uv_process_t and starts the process. */
UV_EXTERN int uv_spawn(uv_loop_t*, uv_process_t*,
uv_process_options_t options);
UV_EXTERN int uv_spawn(uv_loop_t* loop,
uv_process_t* handle,
const uv_process_options_t* options);


/*
Expand Down Expand Up @@ -1872,8 +1903,8 @@ UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle,
/* Utility */

/* Convert string ip addresses to binary structures */
UV_EXTERN struct sockaddr_in uv_ip4_addr(const char* ip, int port);
UV_EXTERN struct sockaddr_in6 uv_ip6_addr(const char* ip, int port);
UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);

/* Convert binary addresses to strings */
UV_EXTERN int uv_ip4_name(struct sockaddr_in* src, char* dst, size_t size);
Expand Down
Loading

0 comments on commit ed8d97f

Please sign in to comment.