Project

General

Profile

Enhancement #750 » 0012-sanitize-link_server-lag-shouldn-t-be-allowed-to-go-.patch

Loïc Gomez, 2022-01-10 19:28

View differences:

src/irc.c
187 187
 */
188 188
void irc_compute_lag(struct link_server *is)
189 189
{
190
	time_t lag;
190 191
	assert(is->laginit_ts != -1);
191
	is->lag = time(NULL) - is->laginit_ts;
192
	lag = time(NULL) - is->laginit_ts;
193
	if (lag > LAGOUT_TIME*2)
194
		is->lag = LAGOUT_TIME*2;
195
	else
196
		is->lag = (unsigned)lag;
192 197
}
193 198

  
194 199
int irc_lags_out(struct link_server *is)
src/irc.h
238 238
	size_t user_mode_len;
239 239

  
240 240
	/* init stuff */
241
	int lag;
242
	int laginit_ts;
241
	unsigned lag;
242
	time_t laginit_ts;
243 243
	int lagtest_timeout;
244 244

  
245 245
	/* chanmodes */
246
- 
(11-11/24)