Skip to content

Commit 96af51b

Browse files
fix error handling in libpcp to prevent endless loop (scp-fs2open#7313)
1 parent d3a8759 commit 96af51b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/libpcpnatpmp/src/pcp_event_handler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,15 @@ static pcp_server_state_e handle_server_ping(pcp_server_t *s) {
834834

835835
PCP_LOG_END(PCP_LOGLVL_DEBUG);
836836
return pss_wait_ping_resp;
837+
} else {
838+
gettimeofday(&s->next_timeout, NULL);
839+
PCP_LOG_END(PCP_LOGLVL_DEBUG);
840+
return pss_set_not_working;
837841
}
838842
}
839843
s->next_timeout.tv_sec = 0;
840844
s->next_timeout.tv_usec = 0;
845+
PCP_LOG_END(PCP_LOGLVL_DEBUG);
841846
return pss_ping;
842847
}
843848

0 commit comments

Comments
 (0)