mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
Use OBJ_NEW*() macros in SocketServer object.
This was missed in ccc255d3 when the TLS server was introduced, probably because work on that commit preceded when the macros were introduced in 475b57c8. It would have been easy to miss in a merge.
This commit is contained in:
parent
6f2654a5eb
commit
eb65a5674d
@ -155,13 +155,12 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
|
||||
IoServer *this = NULL;
|
||||
|
||||
MEM_CONTEXT_NEW_BEGIN("SocketServer")
|
||||
OBJ_NEW_BEGIN(SocketServer)
|
||||
{
|
||||
SocketServer *driver = memNew(sizeof(SocketServer));
|
||||
SocketServer *const driver = OBJ_NEW_ALLOC();
|
||||
|
||||
*driver = (SocketServer)
|
||||
{
|
||||
.memContext = MEM_CONTEXT_NEW(),
|
||||
.address = strDup(address),
|
||||
.port = port,
|
||||
.name = strNewFmt("%s:%u", strZ(address), port),
|
||||
@ -185,7 +184,7 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
"unable to set SO_REUSEADDR");
|
||||
|
||||
// Ensure file descriptor is closed
|
||||
memContextCallbackSet(driver->memContext, sckServerFreeResource, driver);
|
||||
memContextCallbackSet(objMemContext(driver), sckServerFreeResource, driver);
|
||||
|
||||
// Bind the address
|
||||
THROW_ON_SYS_ERROR(
|
||||
@ -205,7 +204,7 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
|
||||
this = ioServerNew(driver, &sckServerInterface);
|
||||
}
|
||||
MEM_CONTEXT_NEW_END();
|
||||
OBJ_NEW_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(IO_SERVER, this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user