network send and recv retry when error EINTR happen

pull/48/head
yuqing 2014-08-02 11:03:02 +08:00
parent 7ed787d837
commit 3b6c9dc5e8
4 changed files with 20 additions and 1 deletions

View File

@ -1,4 +1,7 @@
Version 5.03 2014-08-02
* network send and recv retry when error EINTR happen
Version 5.02 2014-07-20
* corect README spell mistake
* bug fixed: can't deal sync truncate file exception

View File

@ -23,7 +23,7 @@
int g_fdfs_connect_timeout = DEFAULT_CONNECT_TIMEOUT;
int g_fdfs_network_timeout = DEFAULT_NETWORK_TIMEOUT;
char g_fdfs_base_path[MAX_PATH_SIZE] = {'/', 't', 'm', 'p', '\0'};
Version g_fdfs_version = {5, 2};
Version g_fdfs_version = {5, 3};
bool g_use_connection_pool = false;
ConnectionPool g_connection_pool;
int g_connection_pool_max_idle_time = 3600;

View File

@ -322,6 +322,10 @@ static void client_sock_read(int sock, short event, void *arg)
if (errno == EAGAIN || errno == EWOULDBLOCK)
{
}
else if (errno == EINTR)
{
continue;
}
else
{
logError("file: "__FILE__", line: %d, " \
@ -456,6 +460,10 @@ static void client_sock_write(int sock, short event, void *arg)
{
set_send_event(pTask);
}
else if (errno == EINTR)
{
continue;
}
else
{
logError("file: "__FILE__", line: %d, " \

View File

@ -248,6 +248,10 @@ static void client_sock_read(int sock, short event, void *arg)
if (errno == EAGAIN || errno == EWOULDBLOCK)
{
}
else if (errno == EINTR)
{
continue;
}
else
{
logError("file: "__FILE__", line: %d, " \
@ -361,6 +365,10 @@ static void client_sock_write(int sock, short event, void *arg)
{
set_send_event(pTask);
}
else if (errno == EINTR)
{
continue;
}
else
{
logError("file: "__FILE__", line: %d, " \