diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-02-14 08:39:10 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-02-14 08:39:10 +0000 |
commit | d43aa2e692e5689cbd54a4398df51e1f51db3cb9 (patch) | |
tree | 69398a9a7e2f60a4e0f3fdbf6f71a494ecf0b5e8 /libsylph/session.c | |
parent | 0162a14d3bf701fea6b0ff4a2b83e94f5d6b29da (diff) |
win32: avoid blocking when reading from socket.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1001 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/session.c')
-rw-r--r-- | libsylph/session.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libsylph/session.c b/libsylph/session.c index 7a526765..8e7cd835 100644 --- a/libsylph/session.c +++ b/libsylph/session.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2005 Hiroyuki Yamamoto + * Copyright (C) 1999-2006 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -512,6 +512,8 @@ static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition, if (session->read_buf_len == 0) { gint read_len; + if (!sock_has_read_data(session->sock)) + return TRUE; read_len = sock_read(session->sock, session->read_buf, SESSION_BUFFSIZE - 1); @@ -598,6 +600,8 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition, if (session->read_buf_len == 0) { gint read_len; + if (!sock_has_read_data(session->sock)) + return TRUE; read_len = sock_read(session->sock, session->read_buf, SESSION_BUFFSIZE); @@ -709,6 +713,8 @@ static gboolean session_read_data_as_file_cb(SockInfo *source, session_set_timeout(session, session->timeout_interval); if (session->read_buf_len == 0) { + if (!sock_has_read_data(session->sock)) + return TRUE; read_len = sock_read(session->sock, session->read_buf_p, READ_BUF_LEFT()); |