1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

server->cmd_last_split wasn't used anymore, removed code related to it.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1024 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-12-28 17:23:06 +00:00 committed by cras
parent 1a536c204c
commit 46a427b410
3 changed files with 14 additions and 28 deletions

View File

@ -227,7 +227,7 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
{
long usecs;
char *cmd;
int len, add_rawlog;
int len;
if (!IS_IRC_SERVER(server))
return;
@ -235,14 +235,12 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
if (server->cmdcount == 0 && server->cmdqueue == NULL)
return;
if (!server->cmd_last_split) {
if (g_timeval_cmp(now, &server->wait_cmd) == -1)
return;
if (g_timeval_cmp(now, &server->wait_cmd) == -1)
return;
usecs = get_timeval_diff(now, &server->last_cmd);
if (usecs < server->cmd_queue_speed)
return;
}
usecs = get_timeval_diff(now, &server->last_cmd);
if (usecs < server->cmd_queue_speed)
return;
server->cmdcount--;
if (server->cmdqueue == NULL) return;
@ -251,28 +249,19 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
cmd = server->cmdqueue->data;
len = strlen(cmd);
add_rawlog = !server->cmd_last_split;
if (net_sendbuffer_send(server->handle, cmd, len) == -1) {
/* something bad happened */
g_warning("net_sendbuffer_send() failed: %s", g_strerror(errno));
g_warning("net_sendbuffer_send() failed: %s",
g_strerror(errno));
return;
}
server->wait_cmd.tv_sec = 0;
memcpy(&server->last_cmd, now, sizeof(GTimeVal));
if (server->cmd_last_split)
server->cmd_last_split = FALSE;
if (add_rawlog) {
/* add to rawlog without CR+LF */
int slen;
slen = strlen(cmd);
cmd[slen-2] = '\0';
rawlog_output(server->rawlog, cmd);
cmd[slen-2] = '\r';
}
/* add to rawlog without CR+LF */
cmd[len-2] = '\0';
rawlog_output(server->rawlog, cmd);
/* remove from queue */
g_free(cmd);

View File

@ -60,8 +60,6 @@ typedef struct {
there actually is, to make flood control remember
how many messages can be sent before starting the
flood control */
int cmd_last_split; /* Last command wasn't sent entirely to server.
First item in `cmdqueue' should be re-sent. */
GSList *cmdqueue;
GTimeVal wait_cmd; /* don't send anything to server before this */
GTimeVal last_cmd; /* last time command was sent to server */

View File

@ -89,10 +89,9 @@ void irc_send_cmd(IRC_SERVER_REC *server, const char *cmd)
if (server == NULL) return;
g_get_current_time(&now);
send_now = !server->cmd_last_split &&
send_now = g_timeval_cmp(&now, &server->wait_cmd) >= 0 &&
(server->cmdcount < server->max_cmds_at_once ||
server->cmd_queue_speed <= 0) &&
g_timeval_cmp(&now, &server->wait_cmd) >= 0;
server->cmd_queue_speed <= 0);
cmd_send(server, cmd, send_now, FALSE);
}
@ -119,7 +118,7 @@ void irc_send_cmd_now(IRC_SERVER_REC *server, const char *cmd)
g_return_if_fail(cmd != NULL);
if (server == NULL) return;
cmd_send(server, cmd, !server->cmd_last_split, TRUE);
cmd_send(server, cmd, TRUE, TRUE);
}
static char *split_nicks(const char *cmd, char **pre, char **nicks, char **post, int arg)