Fix argument order for dcc_getfile_resume_start()

The last two arguments are port, then offset (as per the DCC ACCEPT CTCP
command).  We don't really use these anyway - port is passed to dcc_create()
but for pre-existing DCC entries all that did was add it to the socketinfo,
which doesn't seem to have any real effect.

Also fix dcc_create() so it passes the actual remote port to add_socketread()
(as above, this doesn't seem to have any real effect but is consistent with
the other code).
This commit is contained in:
Kevin Easton
2015-10-10 22:48:26 +11:00
parent be6bd5aca4
commit fe368ac875

View File

@@ -563,7 +563,7 @@ DCC_List *new_i;
} }
new->remport = ntohs(new->remport); new->remport = ntohs(new->remport);
flags |= DCC_ACTIVE; flags |= DCC_ACTIVE;
add_socketread(new_s, port, flags|type, nick, new_i->sock.func_read, NULL); add_socketread(new_s, new->remport, flags|type, nick, new_i->sock.func_read, NULL);
set_socketinfo(new_s, new); set_socketinfo(new_s, new);
if ((getpeername(new_s, (struct sockaddr *) &remaddr, &rl)) != -1) if ((getpeername(new_s, (struct sockaddr *) &remaddr, &rl)) != -1)
{ {
@@ -3423,14 +3423,14 @@ int old_dp, old_dn, old_dc;
in_ctcp_flag = old_dc; in_ctcp_flag = old_dc;
} }
void dcc_getfile_resume_start (char *nick, char *description, char *address, char *port) void dcc_getfile_resume_start(char *nick, char *description, char *port, char *offset)
{ {
SocketList *s; SocketList *s;
DCC_int *n; DCC_int *n;
const DCC_List *pending; const DCC_List *pending;
char *tmp = NULL; char *tmp = NULL;
char *fullname = NULL; char *fullname = NULL;
struct stat sb; struct stat sb;
/* resume command has been sent and accepted. */ /* resume command has been sent and accepted. */
if (description && !strcmp(description, "file.ext")) if (description && !strcmp(description, "file.ext"))