Triton Repository branch, master, updated. dbe7b913314e0e908aea33c36f28a21424f1d8c2
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via dbe7b913314e0e908aea33c36f28a21424f1d8c2 (commit) from 793aa2f2ab7e0c269f8a1cbab43b40530c8e9932 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dbe7b913314e0e908aea33c36f28a21424f1d8c2 Author: Phil Carns <[email protected]> Date: Thu Jun 16 10:55:20 2011 -0400 triton-socket: try to move data before blocking ----------------------------------------------------------------------- Summary of changes: code/src/socket/triton-socket.ae | 49 +++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 27 deletions(-) Diff of changes: diff --git a/code/src/socket/triton-socket.ae b/code/src/socket/triton-socket.ae index 3f78c0d..13b8f89 100644 --- a/code/src/socket/triton-socket.ae +++ b/code/src/socket/triton-socket.ae @@ -21,26 +21,26 @@ __blocking triton_ret_t triton_accept( *newfd = -1; - do + while(1) { - ret = triton_aesocket_ready(sockfd, AESOCKET_READ | AESOCKET_WRITE); - if (ret != TRITON_SUCCESS) - return ret; - r = accept(sockfd, addr, addrlen); if (r >= 0) - break; - - if (errno == EAGAIN || errno == EWOULDBLOCK) - continue; - - return triton_error_from_errno(errno); - - } while (1); - - *newfd = r; + { + *newfd = r; + return(TRITON_SUCCESS); + } + else if (errno == EAGAIN || errno == EWOULDBLOCK) + { + ret = triton_aesocket_ready(sockfd, AESOCKET_READ | AESOCKET_WRITE); + if (ret != TRITON_SUCCESS) + return ret; + } + else + { + return triton_error_from_errno(errno); + } + } - //printf("newfd=%i\n", *newfd); return TRITON_SUCCESS; } @@ -61,10 +61,6 @@ __blocking triton_ret_t triton_read( do { - ret = triton_aesocket_ready(fd, AESOCKET_READ); - if (ret != TRITON_SUCCESS) - return ret; - r = read(fd, tmp_buf, tmp_count); if(r > 0) { @@ -83,13 +79,14 @@ __blocking triton_ret_t triton_read( } else if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { - continue; + ret = triton_aesocket_ready(fd, AESOCKET_READ); + if (ret != TRITON_SUCCESS) + return ret; } else { return triton_error_from_errno(errno); } - } while (tmp_count > 0); *len = count; @@ -113,10 +110,6 @@ __blocking triton_ret_t triton_write( do { - ret = triton_aesocket_ready(fd, AESOCKET_WRITE); - if (ret != TRITON_SUCCESS) - return ret; - r = write(fd, buf, count); if(r >= 0) { @@ -125,7 +118,9 @@ __blocking triton_ret_t triton_write( } else if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { - continue; + ret = triton_aesocket_ready(fd, AESOCKET_WRITE); + if (ret != TRITON_SUCCESS) + return ret; } else { hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov