[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/aim-toc/libtoc libtoc.c,1.3,1.4
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/aim-toc/libtoc libtoc.c,1.3,1.4 |
Date: |
Thu, 30 Jan 2003 04:39:05 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/aim-toc/libtoc
In directory subversions:/tmp/cvs-serv30946/modules/aim-toc/libtoc
Modified Files:
libtoc.c
Log Message:
change_group() callback
Index: libtoc.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/aim-toc/libtoc/libtoc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- libtoc.c 28 Jan 2003 06:20:05 -0000 1.3
+++ libtoc.c 30 Jan 2003 09:39:02 -0000 1.4
@@ -56,7 +56,7 @@
#define MSG_NOSIGNAL 0
#endif
-#define REVISION "TIC:TOC2:Everybuddy"
+#define REVISION "TIC:TOC2:Ayttm"
#define ROAST "Tic/Toc"
#define TALK_UUID "09461341-4C7F-11D1-8222-444553540000"
@@ -66,9 +66,11 @@
#define SEND_BUDDYLIST "0946134B-4C7F-11D1-8222-444553540000"
#define BUDDY_ICON_UUID "09461346-4C7F-11D1-8222-444553540000"
+extern int do_aim_debug;
+#define DEBUG do_aim_debug
+
static char user_info_id[1024];
-// #define DEBUG
// HACK ALERT - user info hack begin
char * info;
@@ -185,9 +187,9 @@
int i = 0;
int j = 0;
-#ifdef DEBUG
+if(DEBUG)
printf("Decoding %s\n", input );
-#endif
+
for( i = 0, j = 0; input[i]; i+=4, j += 3 )
{
@@ -212,13 +214,13 @@
}
output[j] = 0;
-#ifdef DEBUG
+if(DEBUG) {
for(i = 0; i < j; i += 2 )
{
printf("%c%c", output[i], output[i+1] );
}
printf("\n");
-#endif
+}
return output;
}
@@ -407,9 +409,9 @@
if(!conn)
return;
-#ifdef DEBUG
+if(DEBUG)
printf( "send_flap BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
fh.ast = '*';
fh.type = type;
@@ -432,21 +434,22 @@
}
-#ifdef DEBUG
- printf("%s\n", data);
- printf( "send_flap AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+ if(DEBUG) {
+ printf("%s\n", data);
+ printf( "send_flap AFTER %d %d\n", conn->fd, conn->seq_num );
+ }
}
/*
- void toc_set_config( toc_conn * conn, char * config )
- {
- char buffer[2048];
-
- g_snprintf(buffer, 2048, "toc_set_config \"%s\"", config);
- send_flap(conn, DATA, buffer);
- }
- */
+void toc_set_config( toc_conn * conn, char * config )
+{
+ char buffer[2048];
+
+ g_snprintf(buffer, 2048, "toc_set_config \"%s\"", config);
+if(DEBUG)
+ printf("%s\n",buffer);
+ send_flap(conn, DATA, buffer);
+} */
static void toc_get_file_data( gpointer data, int source, eb_input_condition
condition )
{
@@ -545,17 +548,17 @@
for( i = 0; (fd = connect_address( inet_addr(ip), port )) <= 0
&& i < 10; i++ );
-#ifdef DEBUG
+if(DEBUG)
fprintf(stderr, "connected to %s\n", ip );
-#endif
+
recv( fd, buff2, 6, 0 );
buff2[6] = '\0';
header_size =ntohs(*((short*)(buff2+4)));
-#ifdef DEBUG
+if(DEBUG)
fprintf(stderr, "header_size = %d\n", header_size );
-#endif
+
recv( fd, buff, header_size - 6, 0 );
@@ -566,17 +569,17 @@
return;
}
-#ifdef DEBUG
+if(DEBUG)
fprintf( stderr, "magic = %04x\n", fh->magic );
-#endif
+
fh->magic = htons(0x0202);
memcpy(fh->cookie, cookie2, 8);
g_free(cookie2);
-#ifdef DEBUG
+if(DEBUG) {
fprintf(stderr, "id_string = %s\n", buff + 62 );
fprintf(stderr, "file_name = %s\n", buff + 186 );
-#endif
+}
memset(buff + 62, 0, 32);
strcpy(buff + 62, "TIK");
fh->encryption = 0;
@@ -584,11 +587,11 @@
fh->total_num_parts = htons(1);
fh->total_num_parts_left = htons(1);
-#ifdef DEBUG
+if(DEBUG) {
fprintf(stderr, "total_num_parts = %04x total_num_parts_left =
%04x file_size = %ld\n",
fh->total_num_parts, fh->total_num_parts_left,
ntohl(*((long*)(buff+22))));
-#endif
+}
send( fd, buff2, 6, 0 );
send( fd, buff, header_size - 6, 0 );
@@ -609,37 +612,7 @@
void toc_get_talk( char * ip, short port, char * cookie )
{
-// int fd;
-// int i;
-// char c;
-
-
-// toc_file_conn * conn = g_new0( toc_file_conn, 1 );
-
- fprintf( stderr, "Trying to connect to %s:%d\n", ip, port );
-
-
-
-/*
- port = 4000;
- do
- {
- for( i = 0; (fd = connect_address( inet_addr(ip),
++port )) <= 0 && i < 100; i++ );
- }while(fd<0);
- fprintf(stderr, "Our socket is %d\n", port);
-
- for(;;)
- {
- recv(fd, &c, 1, 0);
- printf("0x%02x", c);
- if(isprint(c))
- {
- printf("\t%c", c);
- }
- printf("\n");
- }
-*/
-
+ fprintf( stderr, "Trying to connect to %s:%d\n", ip, port );
}
void toc_send_keep_alive( toc_conn * conn )
@@ -659,9 +632,9 @@
flap_header fh;
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_send_keep_alive BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
fh.ast = '*';
fh.type = KEEP_ALIVE;
@@ -674,9 +647,9 @@
{
i += write(conn->fd,buff+i,sizeof(flap_header)-i);
}
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_send_keep_alive AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
}
char * get_flap(toc_conn * conn )
@@ -688,9 +661,9 @@
fd_set fs;
int sb,ind;
-#ifdef DEBUG
+if(DEBUG)
printf( "get_flap BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
FD_ZERO(&fs);
FD_SET(conn->fd, &fs);
@@ -737,10 +710,10 @@
}
/* printf("\r\n"); */
-#ifdef DEBUG
+if(DEBUG) {
fprintf(stderr, "Flap length = %d\n", len);
printf( "get_flap AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+}
return buff;
}
@@ -754,9 +727,9 @@
// GList * node;
// char buddies[2048];
-#ifdef DEBUG
+if(DEBUG) {
printf( "toc_callback BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+}
temp = get_flap(conn);
if( temp )
@@ -766,9 +739,9 @@
else
return;
-#ifdef DEBUG
+if(DEBUG)
fprintf(stderr,"Recieved flap: %s\n", buff);
-#endif
+
for( j = 0; buff[i] != ':' && buff[i]; j++, i++ )
@@ -788,17 +761,11 @@
#endif
// end hack (user info)
-
-
- //send_flap(conn,DATA, "toc_add_permit");
- //send_flap(conn,DATA, "toc_add_deny");
-
send_flap(conn, DATA, "toc_init_done");
// HACK ALERT begin user info hack
send_flap(conn, DATA, buff);
// end hack (user info)
- // Old version: send_flap(conn, DATA, "toc_set_info \"Visit
the Everybuddy website at <A
HREF=\\\"http://www.everybuddy.com\\\">http://www.everybuddy.com</A>.\"");
send_flap(conn, DATA, "toc_set_caps
09461343-4C7F-11D1-8222-444553540000 09461344-4C7F-11D1-8222-444553540000
09461341-4C7F-11D1-8222-444553540000 09461347-4C7F-11D1-8222-444553540000
09461348-4C7F-11D1-8222-444553540000 09461345-4C7F-11D1-8222-444553540000
09461346-4C7F-11D1-8222-444553540000");
}
@@ -939,9 +906,9 @@
user[j] = 0;
i++;
-#ifdef DEBUG
+if(DEBUG)
fprintf(stderr, "toc_chat_update_buddy %s, %s, %d\n",
id, user, inside);
-#endif
+
toc_chat_update_buddy( conn, id, user, inside);
}
}
@@ -1111,9 +1078,9 @@
file_tlv +j +9 );
-#ifdef DEBUG
+if(DEBUG)
printf( "TLV value = %s\n", file_tlv + 8 );
-#endif
+
g_free( file_tlv );
}
@@ -1175,9 +1142,9 @@
toc_error_message(parse_error(buff+6));
}
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_callback AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
@@ -1287,9 +1254,9 @@
send_flap(conn, DATA, buff );
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_signon AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
return conn;
@@ -1298,13 +1265,13 @@
void toc_signoff( toc_conn * conn )
{
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_signoff BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
close(conn->fd);
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_signoff AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
}
void toc_chat_join( toc_conn * conn, char * chat_room_name )
@@ -1356,14 +1323,14 @@
/* toc_send_im <Destination User> <Message> [auto] */
char buff[2048];
-#ifdef DEBUG
+if(DEBUG)
printf( "toc2_send_im BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
g_snprintf(buff, 2048, "toc2_send_im %s \"%s\"",
aim_normalize(username), aim_encode(message));
send_flap(conn, DATA, buff);
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_send_im AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
}
@@ -1441,14 +1408,14 @@
{
char buff[2048];
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_set_idle BEFORE %d %d\n", conn->fd, conn->seq_num );
-#endif
+
g_snprintf(buff, 2048, "toc_set_idle %d", idle);
send_flap(conn, DATA, buff);
-#ifdef DEBUG
+if(DEBUG)
printf( "toc_set_idle AFTER %d %d\n", conn->fd, conn->seq_num );
-#endif
+
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/aim-toc/libtoc libtoc.c,1.3,1.4,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.254,1.255 configure.in,1.250,1.251
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.255,1.256 configure.in,1.251,1.252
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.254,1.255 configure.in,1.250,1.251
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.255,1.256 configure.in,1.251,1.252
- Index(es):