[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-2/konversation/konversation
From:       John Tapsell <john () geola ! co ! uk>
Date:       2004-08-19 19:31:36
Message-ID: 20040819193136.5E8AA90C5 () office ! kde ! org
[Download RAW message or body]

CVS commit by johnflux: 

Check the value of 'read' and show the user an error if it fails.


  M +6 -1      server.cpp   1.235


--- kdeextragear-2/konversation/konversation/server.cpp  #1.234:1.235
@@ -15,4 +15,5 @@
 #include <unistd.h>
 #include <sys/socket.h>
+#include <errno.h>
 
 #ifdef __linux__
@@ -958,5 +959,9 @@ void Server::incoming()
 
   len = read(serverSocket.fd(),buffer,BUFFER_LEN-1);
-
+  if(len==-1) {
+        statusView->appendServerMessage(i18n("Error"),i18n("There was an error \
reading the data from the server: %1").arg(strerror(errno))); +        broken(0);
+        return;
+  }
   buffer[len] = 0;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic