- If no callback has been registered for a particular command, the _CxClRecv()
command will actively skip all of the ASYN message (not sure if this works
correctly for _all_ messages... will wait and see)
* Fixed delivery of express messages. Misunderstood protocol.
! Need to detect server capabilities and use old-style SEXP when necessary! At
present, libCxClient is incompatible with older servers. This, I assume, is a
bad thing.
+Revision 1.17 2001/09/14 19:56:08 brian
+* Fixed handling of ASYN messages, I think.
+ - If no callback has been registered for a particular command, the _CxClRecv()
+ command will actively skip all of the ASYN message (not sure if this works
+ correctly for _all_ messages... will wait and see)
+* Fixed delivery of express messages. Misunderstood protocol.
+! Need to detect server capabilities and use old-style SEXP when necessary! At
+ present, libCxClient is incompatible with older servers. This, I assume, is a
+ bad thing.
+
Revision 1.16 2001/09/10 22:40:39 brian
* MAJOR BUG: Memory leaks and protocol misimplementations in misc.c (related
to Express Messaging). UGH!
Revision 1.16 2001/09/10 22:40:39 brian
* MAJOR BUG: Memory leaks and protocol misimplementations in misc.c (related
to Express Messaging). UGH!
Revision 1.2 2001/02/07 22:41:51 brian
* Updated ChangeLog to conform to Citadel/UX standards (kinda) :)
Revision 1.2 2001/02/07 22:41:51 brian
* Updated ChangeLog to conform to Citadel/UX standards (kinda) :)
- DPF((DFA,"REALSEND: \"%s\"", s));
+ DPF((DFA,"PROT --> \"%s\"", s));
ss = (char *)CxMalloc(strlen(s)+2);
sprintf(ss,"%s\n",s);
ss = (char *)CxMalloc(strlen(s)+2);
sprintf(ss,"%s\n",s);
int _CxClRecv( int sock, int *semaphore, char *s, int cxid ) {
char substr[4];
int i, tmp;
int _CxClRecv( int sock, int *semaphore, char *s, int cxid ) {
char substr[4];
int i, tmp;
/**
** If the socket is not open, there's no point in going here.
**/
/**
** If the socket is not open, there's no point in going here.
**/
- DPF((DFA,"Receive on %d", sock));
+ DPF((DFA,"RECV on %d", sock));
if(!sock) {
DPF((DFA,"No socket."));
if(!sock) {
DPF((DFA,"No socket."));
- DPF((DFA,"I got \"%s\"",s));
+ DPF((DFA,"PROT <-- \"%s\"", s));
** This removes the result code & other data from the
** returned string. This is _really_ going to mess with
** lots of code. Ugh.
** This removes the result code & other data from the
** returned string. This is _really_ going to mess with
** lots of code. Ugh.
- **/
- DPF((DFA," s: \"%s\"", s));
-
- /**
- ** Shift the entire string left 4 places.
+ **
+ ** (Shift the entire string left 4 places.)
**/
for(tmp = 0; tmp < strlen(s); tmp++) {
if(tmp+4 < strlen(s)) s[tmp] = s[tmp+4];
**/
for(tmp = 0; tmp < strlen(s); tmp++) {
if(tmp+4 < strlen(s)) s[tmp] = s[tmp+4];
/**
** ... Callback has failed. We need to
** proactively ignore this message now.
/**
** ... Callback has failed. We need to
** proactively ignore this message now.
+ ** NOTE: WE MAY NEED TO ROLL THE SOCKET
+ ** FORWARD TO SKIP ALL OUT-OF-BAND
+ ** MESSAGES!
+ DPF((DFA,"PROT: ROLL: Rolling socket forward (CALLBACK FAILURE)"));
+ tmpstr = (char *)CxMalloc( 255 );
+ bzero( tmpstr, 254 );
+ i = _CxClRecv( sock, semaphore, tmpstr, cxid );
+ do {
+
+ i = _CxClRecv( sock, semaphore, tmpstr, cxid );
+ DPF(( DFA,"PROT: ROLL: i: %d", i ));
+
+ } while( i<0 );
+ free( tmpstr );
+ DPF((DFA,"PROT: ROLL: Cleared OOB data."));
+
+ /**
+ ** Previously, I returned 000 upon receiving an
+ ** ASYN message. This was the incorrect behaviour,
+ ** as the expected RECV operation has _not_ been
+ ** completed! At this point, our Callback should've
+ ** executed appropriately, and we can resume reading
+ ** from the Socket as previously planned.
+ **/
+ /**
+ ** If there are no callback handles, we need to ignore
+ ** what we just saw. NOTE: WE MAY NEED TO ROLL THE
+ ** SOCKET FORWARD TO SKIP ALL OUT-OF-BAND MESSAGES!
+ **/
+ DPF((DFA,"PROT: ROLL: Rolling socket forward (NO CALLBACK)"));
+ tmpstr = (char *)CxMalloc( 255 );
+ bzero( tmpstr, 254 );
+ i = _CxClRecv( sock, semaphore, tmpstr, cxid );
+ do {
+
+ i = _CxClRecv( sock, semaphore, tmpstr, cxid );
+ DPF(( DFA,"PROT: ROLL: i: %d", i ));
+
+ } while( i<0 );
+ free( tmpstr );
+ DPF((DFA,"PROT: ROLL: Cleared OOB data."));
if( rc<0 ) {
DPF(( DFA, "data_buf szlen %d", strlen(data_buf) + strlen(buf) +1));
if( strlen(buf) ) {
if( rc<0 ) {
DPF(( DFA, "data_buf szlen %d", strlen(data_buf) + strlen(buf) +1));
if( strlen(buf) ) {
- realloc(data_buf, strlen(data_buf)+strlen(buf)+1);
+ data_buf = realloc(data_buf, strlen(data_buf)+strlen(buf)+1);
strcat(data_buf, buf);
}
}
strcat(data_buf, buf);
}
}
fl = CxLlFlush(fl);
CxMiExpSend(hndl, "detsaoT","Hello, World. This is a long diatribe\n on the evils of something\nof which the world may never know.");
fl = CxLlFlush(fl);
CxMiExpSend(hndl, "detsaoT","Hello, World. This is a long diatribe\n on the evils of something\nof which the world may never know.");
CxMiExpSend(hndl, "detsaoT","How are you? I am fine. If you see the optional potential of the explicit implicity of the file, you'll know what I mean.");
CxMiExpSend(hndl, "detsaoT","How are you? I am fine. If you see the optional potential of the explicit implicity of the file, you'll know what I mean.");
CxMiExpSend(hndl, "detsaoT","Blah blah blah.");
CxMiExpSend(hndl, "detsaoT","Blah blah blah.");