nread should have type ssize_t
This commit is contained in:
parent
b168bd1f70
commit
b3863c8051
@ -125,7 +125,7 @@ static void pinger_shutdown_cb(uv_handle_t* handle, int status) {
|
||||
}
|
||||
|
||||
|
||||
static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
|
||||
static void pinger_read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
|
||||
unsigned int i;
|
||||
pinger_t* pinger;
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ static void start_stats_collection() {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_tcp_t* tcp, int bytes, uv_buf_t buf) {
|
||||
static void read_cb(uv_tcp_t* tcp, ssize_t bytes, uv_buf_t buf) {
|
||||
if (nrecv_total == 0) {
|
||||
ASSERT(start_time == 0);
|
||||
uv_update_time();
|
||||
|
||||
@ -36,7 +36,7 @@ static uv_tcp_t server;
|
||||
|
||||
|
||||
static void after_write(uv_req_t* req, int status);
|
||||
static void after_read(uv_tcp_t*, int nread, uv_buf_t buf);
|
||||
static void after_read(uv_tcp_t*, ssize_t nread, uv_buf_t buf);
|
||||
static void on_close(uv_handle_t* peer);
|
||||
static void on_server_close(uv_handle_t* handle);
|
||||
static void on_connection(uv_tcp_t*, int status);
|
||||
@ -65,7 +65,7 @@ static void after_shutdown(uv_req_t* req, int status) {
|
||||
}
|
||||
|
||||
|
||||
static void after_read(uv_tcp_t* handle, int nread, uv_buf_t buf) {
|
||||
static void after_read(uv_tcp_t* handle, ssize_t nread, uv_buf_t buf) {
|
||||
int i;
|
||||
write_req_t *wr;
|
||||
uv_req_t* req;
|
||||
|
||||
@ -67,7 +67,7 @@ static void shutdown_cb(uv_req_t* req, int status) {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
|
||||
static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
|
||||
ASSERT(nested == 0 && "read_cb must be called from a fresh stack");
|
||||
|
||||
printf("Read. nread == %d\n", nread);
|
||||
|
||||
@ -121,7 +121,7 @@ static void start_server() {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
|
||||
static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
|
||||
/* The server will not send anything, it should close gracefully. */
|
||||
ASSERT(tcp != NULL);
|
||||
ASSERT(nread == -1);
|
||||
|
||||
@ -92,7 +92,7 @@ static void pinger_write_ping(pinger_t* pinger) {
|
||||
}
|
||||
|
||||
|
||||
static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
|
||||
static void pinger_read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
|
||||
unsigned int i;
|
||||
pinger_t* pinger;
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ static uv_buf_t alloc_cb(uv_tcp_t* tcp, size_t size) {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_tcp_t* t, int nread, uv_buf_t buf) {
|
||||
static void read_cb(uv_tcp_t* t, ssize_t nread, uv_buf_t buf) {
|
||||
ASSERT(t == &tcp);
|
||||
|
||||
if (!got_q) {
|
||||
|
||||
@ -83,7 +83,7 @@ static void shutdown_cb(uv_req_t* req, int status) {
|
||||
}
|
||||
|
||||
|
||||
static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
|
||||
static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
|
||||
ASSERT(tcp != NULL);
|
||||
|
||||
if (nread < 0) {
|
||||
|
||||
2
uv.h
2
uv.h
@ -57,7 +57,7 @@ typedef struct uv_req_s uv_req_t;
|
||||
* user.
|
||||
*/
|
||||
typedef uv_buf_t (*uv_alloc_cb)(uv_tcp_t* tcp, size_t suggested_size);
|
||||
typedef void (*uv_read_cb)(uv_tcp_t* tcp, int nread, uv_buf_t buf);
|
||||
typedef void (*uv_read_cb)(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf);
|
||||
typedef void (*uv_write_cb)(uv_req_t* req, int status);
|
||||
typedef void (*uv_connect_cb)(uv_req_t* req, int status);
|
||||
typedef void (*uv_shutdown_cb)(uv_req_t* req, int status);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user