libpurple/protocols/irc/irc.h

branch
release-2.x.y
changeset 41335
c49dcf00bee6
parent 41332
770040cb6000
child 41339
3230f4408394
--- a/libpurple/protocols/irc/irc.h	Sat Apr 23 05:05:15 2022 -0500
+++ b/libpurple/protocols/irc/irc.h	Sat Apr 23 05:05:54 2022 -0500
@@ -29,7 +29,6 @@
 #include <sasl/sasl.h>
 #endif
 
-#include "circbuffer.h"
 #include "ft.h"
 #include "roomlist.h"
 #include "sslconn.h"
@@ -43,6 +42,13 @@
 
 #define IRC_DEFAULT_QUIT "Leaving."
 
+/* By default set the command send interval to 2 seconds and allow bursting of
+ * 5 commands at once.  This means, if we haven't sent a command in 10 seconds
+ * we can send 5 commands immediately with no penalty.
+ */
+#define IRC_DEFAULT_COMMAND_INTERVAL 2
+#define IRC_DEFAULT_COMMAND_MAX_BURST 5
+
 #define IRC_BUFSIZE_INCREMENT 1024
 #define IRC_MAX_BUFSIZE 16384
 
@@ -92,10 +98,12 @@
 
 	gboolean quitting;
 
-	PurpleCircBuffer *outbuf;
-	guint writeh;
+	time_t recv_time;
 
-	time_t recv_time;
+	GQueue *send_queue;
+	time_t send_time;
+	guint send_handler;
+	gboolean sent_partial;
 
 	char *mode_chars;
 	char *reqnick;
@@ -119,8 +127,9 @@
 
 typedef int (*IRCCmdCallback) (struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 
-int irc_send(struct irc_conn *irc, const char *buf);
-int irc_send_len(struct irc_conn *irc, const char *buf, int len);
+void irc_send(struct irc_conn *irc, const char *buf);
+void irc_send_len(struct irc_conn *irc, const char *buf, int len);
+void irc_priority_send(struct irc_conn *irc, const char *buf);
 gboolean irc_blist_timeout(struct irc_conn *irc);
 gboolean irc_who_channel_timeout(struct irc_conn *irc);
 void irc_buddy_query(struct irc_conn *irc);

mercurial