Skip to content

Commit

Permalink
use time_t for comm{Set,Unset}ConnTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kinkie committed Dec 1, 2024
1 parent 224061c commit efe6da9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ commUnsetFdTimeout(int fd)
F->timeout = 0;
}

int
time_t
commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
{
debugs(5, 3, conn << " timeout " << timeout);
Expand All @@ -614,7 +614,7 @@ commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCal
return F->timeout;
}

int
time_t
commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
{
debugs(5, 3, "Remove timeout for " << conn);
Expand Down
4 changes: 2 additions & 2 deletions src/comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void commUnsetFdTimeout(int fd);
* Set or clear the timeout for some action on an active connection.
* API to replace commSetTimeout() when a Comm::ConnectionPointer is available.
*/
int commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t seconds, AsyncCall::Pointer &callback);
int commUnsetConnTimeout(const Comm::ConnectionPointer &conn);
time_t commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t seconds, AsyncCall::Pointer &callback);
time_t commUnsetConnTimeout(const Comm::ConnectionPointer &conn);

int ignoreErrno(int);
void commCloseAllSockets(void);
Expand Down
4 changes: 2 additions & 2 deletions src/tests/stub_comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ int comm_udp_sendto(int, const Ip::Address &, const void *, int) STUB_RETVAL(-1)
void commCallCloseHandlers(int) STUB
void commUnsetFdTimeout(int) STUB
// int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
int commSetConnTimeout(const Comm::ConnectionPointer &, time_t, AsyncCall::Pointer &) STUB_RETVAL(-1)
int commUnsetConnTimeout(const Comm::ConnectionPointer &) STUB_RETVAL(-1)
time_t commSetConnTimeout(const Comm::ConnectionPointer &, time_t, AsyncCall::Pointer &) STUB_RETVAL(-1)
time_t commUnsetConnTimeout(const Comm::ConnectionPointer &) STUB_RETVAL(-1)
int ignoreErrno(int) STUB_RETVAL(-1)
void commCloseAllSockets(void) STUB
void checkTimeouts(void) STUB
Expand Down

0 comments on commit efe6da9

Please sign in to comment.