From: mid Date: Wed, 31 May 2000 01:21:44 +0000 (+0000) Subject: - Wed May 31 01:17:24 UTC 2000 X-Git-Tag: rel_0_99_2~157 X-Git-Url: http://andersk.mit.edu/gitweb/libfaim.git/commitdiff_plain/9193124799d56ddd6b72f1c5f3cda244dd9a21b0 - Wed May 31 01:17:24 UTC 2000 - Added constants for message sizes (MAXMSGLEN, MAXCHATMSGLEN) - Note that the new max message size is defined as 7988bytes, drastically larger than WinAIM lets you put out. This is a libfaim-exclusive feature :) - Reduced base buffer size on aim_send_im() --- diff --git a/CHANGES b/CHANGES index d8ac39f..f49d5b6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ No release numbers ------------------ + - Wed May 31 01:17:24 UTC 2000 + - Added constants for message sizes (MAXMSGLEN, MAXCHATMSGLEN) + - Note that the new max message size is defined as 7988bytes, + drastically larger than WinAIM lets you put out. This is a + libfaim-exclusive feature :) + - Reduced base buffer size on aim_send_im() + - Tue May 30 22:32:31 UTC 2000 - Added lock around tx seqnum to prevent that race when transmitting from diverse threads. (actually committed earlier today) diff --git a/aim_im.c b/aim_im.c index 7f95181..586a738 100644 --- a/aim_im.c +++ b/aim_im.c @@ -25,7 +25,10 @@ u_long aim_send_im(struct aim_session_t *sess, int curbyte,i; struct command_tx_struct *newpacket; - if (!(newpacket = aim_tx_new(0x0002, conn, 1152))) + if (strlen(msg) >= MAXMSGLEN) + return -1; + + if (!(newpacket = aim_tx_new(0x0002, conn, strlen(msg)+256))) return -1; newpacket->lock = 1; /* lock struct */ diff --git a/aim_meta.c b/aim_meta.c index cb00187..3b054f1 100644 --- a/aim_meta.c +++ b/aim_meta.c @@ -7,12 +7,12 @@ #include #include /* generated by mkbuildinfo.sh */ -long long aim_getbuilddate(void) +char *aim_getbuilddate(void) { return AIM_BUILDDATE; } -long long aim_getbuildtime(void) +char *aim_getbuildtime(void) { return AIM_BUILDTIME; } @@ -21,7 +21,7 @@ char *aim_getbuildstring(void) { static char string[100]; - snprintf(string, 99, "%d.%d.%d-%Ld%Ld", + snprintf(string, 99, "%d.%d.%d-%s%s", FAIM_VERSION_MAJOR, FAIM_VERSION_MINOR, FAIM_VERSION_MINORMINOR, diff --git a/faim/aim.h b/faim/aim.h index e4e995e..498fa5f 100644 --- a/faim/aim.h +++ b/faim/aim.h @@ -61,6 +61,31 @@ */ #define MAXSNLEN 16 +/* + * Current Maximum Length for Instant Messages + * + * This was found basically by experiment, but not wholly + * accurate experiment. It should not be regarded + * as completely correct. But its a decent approximation. + * + * Note that although we can send this much, its impossible + * for WinAIM clients (up through the latest (4.0.1957)) to + * send any more than 1kb. Amaze all your windows friends + * with uterrly oversized instant messages! + * + */ +#define MAXMSGLEN 7988 + +/* + * Current Maximum Length for Chat Room Messages + * + * This is actually defined by the protocol to be + * dynamic, but I have yet to see due cause to + * define it dynamically here. Maybe later. + * + */ +#define MAXCHATMSGLEN 512 + /* * Standard size of an AIM authorization cookie */ @@ -529,8 +554,8 @@ int aim_snlen(const char *sn); int aim_sncmp(const char *sn1, const char *sn2); /* aim_meta.c */ -long long aim_getbuilddate(void); -long long aim_getbuildtime(void); +char *aim_getbuilddate(void); +char *aim_getbuildtime(void); char *aim_getbuildstring(void); #endif /* __AIM_H__ */ diff --git a/mkbuildinfo.sh b/mkbuildinfo.sh index 5eb1c4f..ed36c5a 100755 --- a/mkbuildinfo.sh +++ b/mkbuildinfo.sh @@ -1,6 +1,10 @@ #!/bin/bash rm -rf aim_meta.o aim_buildcode.h -echo -n "#define AIM_BUILDDATE " > aim_buildcode.h -echo `date +%Y%m%e` >> aim_buildcode.h -echo -n "#define AIM_BUILDTIME " >> aim_buildcode.h -echo `date +%H%M%S` >> aim_buildcode.h + +echo -n "#define AIM_BUILDDATE \"" > aim_buildcode.h +echo -n `date +%Y%m%e` >> aim_buildcode.h +echo "\"" >> aim_buildcode.h + +echo -n "#define AIM_BUILDTIME \"" >> aim_buildcode.h +echo -n `date +%H%M%S` >> aim_buildcode.h +echo "\"" >> aim_buildcode.h \ No newline at end of file