This commit is contained in:
Max Lv
2016-05-26 14:35:02 +08:00
parent 7f9e13d473
commit 0cfae045e8
7 changed files with 21 additions and 6 deletions
+2 -2
View File
@@ -278,7 +278,7 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents)
// connecting, wait until connected
int r = connect(remote->fd, (struct sockaddr *)&(remote->addr), remote->addr_len);
if (r < 0 && errno != EINPROGRESS) {
if (r < 0 && errno != CONNECT_IN_PROGRESS) {
ERROR("connect");
close_and_free_remote(EV_A_ remote);
close_and_free_server(EV_A_ server);
@@ -315,7 +315,7 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents)
(struct sockaddr *)&(remote->addr), remote->addr_len);
#endif
if (s == -1) {
if (errno == EINPROGRESS) {
if (errno == CONNECT_IN_PROGRESS) {
// in progress, wait until connected
remote->buf->idx = 0;
ev_io_stop(EV_A_ & server_recv_ctx->io);
+1 -1
View File
@@ -650,7 +650,7 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
int r = connect(remotefd, remote_addr, get_sockaddr_len(remote_addr));
if (r < 0 && errno != EINPROGRESS) {
if (r < 0 && errno != CONNECT_IN_PROGRESS) {
ERROR("connect");
close_and_free_remote(EV_A_ remote);
close_and_free_server(EV_A_ server);
+2 -2
View File
@@ -457,7 +457,7 @@ static remote_t *connect_to_remote(struct addrinfo *res,
res->ai_addrlen);
#endif
if (s == -1) {
if (errno == EINPROGRESS || errno == EAGAIN
if (errno == CONNECT_IN_PROGRESS || errno == EAGAIN
|| errno == EWOULDBLOCK) {
// The remote server doesn't support tfo or it's the first connection to the server.
// It will automatically fall back to conventional TCP.
@@ -482,7 +482,7 @@ static remote_t *connect_to_remote(struct addrinfo *res,
if (!fast_open) {
int r = connect(sockfd, res->ai_addr, res->ai_addrlen);
if (r < 0 && errno != EINPROGRESS) {
if (r < 0 && errno != CONNECT_IN_PROGRESS) {
ERROR("connect");
close(sockfd);
return NULL;
+1 -1
View File
@@ -660,7 +660,7 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
int r = connect(remotefd, remote_addr, get_sockaddr_len(remote_addr));
if (r < 0 && errno != EINPROGRESS) {
if (r < 0 && errno != CONNECT_IN_PROGRESS) {
ERROR("connect");
close_and_free_remote(EV_A_ remote);
close_and_free_server(EV_A_ server);