0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

connect: fix tmpport handling

This commit is contained in:
William Pitcock 2016-03-02 16:32:27 -06:00
parent 428f9bc117
commit 08e43ffb21

View file

@ -110,7 +110,7 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
* use the default form configuration structure. If missing * use the default form configuration structure. If missing
* from there, then use the precompiled default. * from there, then use the precompiled default.
*/ */
tmpport = port = 0; port = 0;
if(parc > 2 && !EmptyString(parv[2])) if(parc > 2 && !EmptyString(parv[2]))
port = atoi(parv[2]); port = atoi(parv[2]);
if(port == 0 && server_p->port) if(port == 0 && server_p->port)
@ -127,7 +127,9 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
ilog(L_SERVER, "CONNECT From %s : %s %s", source_p->name, parv[1], parc > 2 ? parv[2] : ""); ilog(L_SERVER, "CONNECT From %s : %s %s", source_p->name, parv[1], parc > 2 ? parv[2] : "");
tmpport = server_p->port;
server_p->port = port; server_p->port = port;
/* /*
* at this point we should be calling connect_server with a valid * at this point we should be calling connect_server with a valid
* C:line and a valid port in the C:line * C:line and a valid port in the C:line
@ -145,9 +147,10 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
/* /*
* client is either connecting with all the data it needs or has been * client is either connecting with all the data it needs or has been
* destroyed * destroyed, so reset it back to the configured settings
*/ */
server_p->port = tmpport; server_p->port = tmpport;
return 0; return 0;
} }