Allow many large messages
This commit is contained in:
		
							parent
							
								
									3430836143
								
							
						
					
					
						commit
						9ab51f0296
					
				| @ -26,7 +26,7 @@ | ||||
| #include "util/list.h" | ||||
| #include "util/cbuffer.h" | ||||
| 
 | ||||
| #define MAX_HISTORY_SIZE 16384 | ||||
| #define MAX_HISTORY_SIZE 614400 | ||||
| 
 | ||||
| struct chat_history_data | ||||
| { | ||||
|  | ||||
| @ -20,6 +20,7 @@ | ||||
| #include "uhub.h" | ||||
| 
 | ||||
| #define CBUF_FLAG_CONST_BUFFER 0x01 | ||||
| #define MAX_MSG_LEN 16384 | ||||
| 
 | ||||
| struct cbuffer | ||||
| { | ||||
| @ -86,19 +87,19 @@ void cbuf_append(struct cbuffer* buf, const char* msg) | ||||
| 
 | ||||
| void cbuf_append_format(struct cbuffer* buf, const char* format, ...) | ||||
| { | ||||
| 	static char tmp[1024]; | ||||
| 	static char tmp[MAX_MSG_LEN]; | ||||
| 	va_list args; | ||||
| 	int bytes; | ||||
| 	uhub_assert(buf->flags == 0); | ||||
| 	va_start(args, format); | ||||
| 	bytes = vsnprintf(tmp, 1024, format, args); | ||||
| 	bytes = vsnprintf(tmp, sizeof(tmp), format, args); | ||||
| 	va_end(args); | ||||
| 	cbuf_append_bytes(buf, tmp, bytes); | ||||
| } | ||||
| 
 | ||||
| void cbuf_append_strftime(struct cbuffer* buf, const char* format, const struct tm* tm) | ||||
| { | ||||
| 	static char tmp[1024]; | ||||
| 	static char tmp[MAX_MSG_LEN]; | ||||
| 	int bytes; | ||||
| 	uhub_assert(buf->flags == 0); | ||||
| 	bytes = strftime(tmp, sizeof(tmp), format, tm); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user