]> code.citadel.org Git - citadel.git/commitdiff
* Fixed problem in which unconnected clients send messages to file descriptor
authorBrian <brian@uncensored.citadel.org>
Mon, 19 Feb 2001 14:50:58 +0000 (14:50 +0000)
committerBrian <brian@uncensored.citadel.org>
Mon, 19 Feb 2001 14:50:58 +0000 (14:50 +0000)
0 (stdout), Now CxClSend() should do nothing if not connected.

libCxClient/ChangeLog
libCxClient/src/libtransport.c

index 0946d4d8b6425aa77c819dfb16c2b9f584357163..3ff1307c6f68fdb7883b0f5f58576713353ead96 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 1.5  2001/02/19 14:50:58  brian
+* Fixed problem in which unconnected clients send messages to file descriptor
+0 (stdout), Now CxClSend() should do nothing if not connected.
+
 Revision 1.4  2001/02/14 03:48:51  brian
 * Added the NOTES file, containing some thoughts about the ASYN protocol,
 eloquently elaborated upon by AJC (Ig).
@@ -9,4 +13,3 @@ Revision 1.3  2001/02/07 22:42:24  brian
 Revision 1.2  2001/02/07 22:41:51  brian
 * Updated ChangeLog to conform to Citadel/UX standards (kinda)  :)
 
-
index 1c086e276c1ba72e080108f710facacaa46de1f8..c304f241209cc3adb7c417e6e2ebc4b2ae351d76 100644 (file)
@@ -177,7 +177,7 @@ void                CxClDisconnect() {
 }
 
 /**
- ** CxClStat(): Send a string to the server.
+ ** CxClStat(): Return connection status.
  **/
 int            CxClStat() {
 
@@ -196,6 +196,11 @@ int                bytes_written = 0;
 int            retval,nbytes;
 char           *ss;
 
+       /**
+        ** Don't try to do anything if we are not connected.
+        **/
+       if(!CxClStat()) return;
+
        DPF((DFA,"SEND: \"%s\"", s));
 
        ss = (char *)CxMalloc(strlen(s)+2);
@@ -267,9 +272,10 @@ int                CxClRecv(char *s) {
 char           substr[4];
 int            i, tmp;
 
-       if(!CxClStat()) {
-               return(NULL);
-       }
+       /**
+        ** If we are not connected, do nothing.
+        **/
+       if(!CxClStat()) return(NULL);
 
        /**
         ** At this point, we should wait for the semaphore to be cleared.