summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-12-15 19:44:27 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-12-15 19:44:27 +0000
commit4ea69f305915024e690fb1fa7a848cca6fe1a07c (patch)
tree052abf05445490c9d5c1e352366b38b6ef9743ea /src
parentf6efe1cad8ee10a6d5eba987bc9654508ff58453 (diff)
downloadirssi-4ea69f305915024e690fb1fa7a848cca6fe1a07c.zip
Blocking sockets (win32) shouldn't block irssi entirely now.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@991 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/irc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c
index fece504c..b1bcd0bf 100644
--- a/src/irc/core/irc.c
+++ b/src/irc/core/irc.c
@@ -36,6 +36,12 @@ static int signal_default_event;
static int signal_server_event;
static int signal_server_incoming;
+#ifdef BLOCKING_SOCKETS
+# define MAX_SOCKET_READS 1
+#else
+# define MAX_SOCKET_READS 5
+#endif
+
static void cmd_send(IRC_SERVER_REC *server, const char *cmd, int send_now, int immediate)
{
char str[513], *ptr;
@@ -341,10 +347,10 @@ static void irc_parse_incoming(SERVER_REC *server)
g_return_if_fail(server != NULL);
/* Some commands can send huge replies and irssi might handle them
- too slowly, so read only max. 5 times from the socket before
+ too slowly, so read only a few times from the socket before
letting other tasks to run. */
count = 0;
- while (irc_receive_line(server, &str, count < 5) > 0) {
+ while (irc_receive_line(server, &str, count < MAX_SOCKET_READS) > 0) {
rawlog_input(server->rawlog, str);
signal_emit_id(signal_server_incoming, 2, server, str);