From 89bce17768d14f77b0a3fa612d56372f3b6ded5c Mon Sep 17 00:00:00 2001 From: mid Date: Wed, 13 Dec 2000 00:42:28 +0000 Subject: [PATCH] - Wed Dec 13 00:38:56 UTC 2000 - Added the client update/version info to the authresp callback - Added the prototype for aim_getfile_send_chunk to aim.h --- CHANGES | 4 ++++ aim_ft.c | 1 - aim_login.c | 41 ++++++++++++++++++++++++++++++++++++++- faim/aim.h | 1 + utils/faimtest/faimtest.c | 23 +++++++++++++++++++++- 5 files changed, 67 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4f8bcf4..5ee16cd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ No release numbers ------------------ + - Wed Dec 13 00:38:56 UTC 2000 + - Added the client update/version info to the authresp callback + - Added the prototype for aim_getfile_send_chunk to aim.h + - Tue Dec 12 23:02:41 UTC 2000 - Got pissed off at sess->logininfo. Got rid of it. - Now pass all that stuff in as varargs, like it should be. diff --git a/aim_ft.c b/aim_ft.c index 8c29692..b47eef6 100644 --- a/aim_ft.c +++ b/aim_ft.c @@ -1591,7 +1591,6 @@ faim_export int aim_getfile_send(struct aim_conn_t *conn, FILE *tosend, struct a * if (pos + chunksize > fh->size), we only send as much data as we * can get (ie: up to fh->size. */ - faim_export int aim_getfile_send_chunk(struct aim_conn_t *conn, FILE *tosend, struct aim_fileheader_t *fh, int pos, int bufsize) { int bufpos; diff --git a/aim_login.c b/aim_login.c index 4c4a2e6..2b5e92b 100644 --- a/aim_login.c +++ b/aim_login.c @@ -298,6 +298,10 @@ faim_internal int aim_authparse(struct aim_session_t *sess, char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL; unsigned char *cookie = NULL; int errorcode = 0, regstatus = 0; + int latestbuild = 0, latestbetabuild = 0; + char *latestrelease = NULL, *latestbeta = NULL; + char *latestreleaseurl = NULL, *latestbetaurl = NULL; + char *latestreleaseinfo = NULL, *latestbetainfo = NULL; /* * Read block of TLVs. All further data is derived @@ -361,9 +365,31 @@ faim_internal int aim_authparse(struct aim_session_t *sess, if (aim_gettlv(tlvlist, 0x0013, 1)) regstatus = aim_gettlv16(tlvlist, 0x0013, 1); + if (aim_gettlv(tlvlist, 0x0040, 1)) + latestbetabuild = aim_gettlv32(tlvlist, 0x0040, 1); + if (aim_gettlv(tlvlist, 0x0041, 1)) + latestbetaurl = aim_gettlv_str(tlvlist, 0x0041, 1); + if (aim_gettlv(tlvlist, 0x0042, 1)) + latestbetainfo = aim_gettlv_str(tlvlist, 0x0042, 1); + if (aim_gettlv(tlvlist, 0x0043, 1)) + latestbeta = aim_gettlv_str(tlvlist, 0x0043, 1); + if (aim_gettlv(tlvlist, 0x0048, 1)) + ; /* no idea what this is */ + + if (aim_gettlv(tlvlist, 0x0044, 1)) + latestbuild = aim_gettlv32(tlvlist, 0x0044, 1); + if (aim_gettlv(tlvlist, 0x0045, 1)) + latestreleaseurl = aim_gettlv_str(tlvlist, 0x0045, 1); + if (aim_gettlv(tlvlist, 0x0046, 1)) + latestreleaseinfo = aim_gettlv_str(tlvlist, 0x0046, 1); + if (aim_gettlv(tlvlist, 0x0047, 1)) + latestrelease = aim_gettlv_str(tlvlist, 0x0047, 1); + if (aim_gettlv(tlvlist, 0x0049, 1)) + ; /* no idea what this is */ + if ((userfunc = aim_callhandler(command->conn, 0x0017, 0x0003))) - ret = userfunc(sess, command, sn, errorcode, errurl, regstatus, email, bosip, cookie); + ret = userfunc(sess, command, sn, errorcode, errurl, regstatus, email, bosip, cookie, latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo, latestbeta, latestbetabuild, latestbetaurl, latestbetainfo); if (sn) @@ -376,6 +402,19 @@ faim_internal int aim_authparse(struct aim_session_t *sess, free(email); if (cookie) free(cookie); + if (latestrelease) + free(latestrelease); + if (latestreleaseurl) + free(latestreleaseurl); + if (latestbeta) + free(latestbeta); + if (latestbetaurl) + free(latestbetaurl); + if (latestreleaseinfo) + free(latestreleaseinfo); + if (latestbetainfo) + free(latestbetainfo); + aim_freetlvchain(&tlvlist); return ret; diff --git a/faim/aim.h b/faim/aim.h index a83632d..0c96008 100644 --- a/faim/aim.h +++ b/faim/aim.h @@ -447,6 +447,7 @@ faim_internal unsigned long aim_genericreq_s(struct aim_session_t *, struct aim_ faim_internal struct aim_fileheader_t *aim_oft_getfh(unsigned char *hdr); faim_export int aim_oft_registerlisting(struct aim_session_t *sess, FILE *file, char* listingdir); faim_export int aim_getfile_send(struct aim_conn_t *conn, FILE *tosend, struct aim_fileheader_t *fh); +faim_export int aim_getfile_send_chunk(struct aim_conn_t *conn, FILE *tosend, struct aim_fileheader_t *fh, int pos, int bufsize); /* aim_login.c */ faim_export int aim_sendconnack(struct aim_session_t *sess, struct aim_conn_t *conn); diff --git a/utils/faimtest/faimtest.c b/utils/faimtest/faimtest.c index a8b8437..d101c9f 100644 --- a/utils/faimtest/faimtest.c +++ b/utils/faimtest/faimtest.c @@ -551,7 +551,11 @@ int faimtest_parse_authresp(struct aim_session_t *sess, struct command_rx_struct char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL; unsigned char *cookie = NULL; int errorcode = 0, regstatus = 0; - + int latestbuild = 0, latestbetabuild = 0; + char *latestrelease = NULL, *latestbeta = NULL; + char *latestreleaseurl = NULL, *latestbetaurl = NULL; + char *latestreleaseinfo = NULL, *latestbetainfo = NULL; + va_start(ap, command); sn = va_arg(ap, char *); errorcode = va_arg(ap, int); @@ -560,6 +564,17 @@ int faimtest_parse_authresp(struct aim_session_t *sess, struct command_rx_struct email = va_arg(ap, char *); bosip = va_arg(ap, char *); cookie = va_arg(ap, unsigned char *); + + latestrelease = va_arg(ap, char *); + latestbuild = va_arg(ap, int); + latestreleaseurl = va_arg(ap, char *); + latestreleaseinfo = va_arg(ap, char *); + + latestbeta = va_arg(ap, char *); + latestbetabuild = va_arg(ap, int); + latestbetaurl = va_arg(ap, char *); + latestbetainfo = va_arg(ap, char *); + va_end(ap); printf("Screen name: %s\n", sn); @@ -578,6 +593,12 @@ int faimtest_parse_authresp(struct aim_session_t *sess, struct command_rx_struct printf("Email: %s\n", email); printf("BOS IP: %s\n", bosip); + if (latestbeta) + printf("Latest beta version: %s, build %d, at %s (more info at %s)\n", latestbeta, latestbetabuild, latestbetaurl, latestbetainfo); + + if (latestrelease) + printf("Latest released version: %s, build %d, at %s (more info at %s)\n", latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo); + printf("Closing auth connection...\n"); aim_conn_kill(sess, &command->conn); if (!(bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, bosip))) { -- 2.45.1