gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9932: minor change to error handling


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9932: minor change to error handling return codes.
Date: Tue, 30 Dec 2008 14:06:48 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9932
committer: address@hidden
branch nick: rtmp
timestamp: Tue 2008-12-30 14:06:48 -0700
message:
  minor change to error handling return codes.
modified:
  libnet/network.cpp
=== modified file 'libnet/network.cpp'
--- a/libnet/network.cpp        2008-12-18 00:47:19 +0000
+++ b/libnet/network.cpp        2008-12-30 21:06:48 +0000
@@ -905,10 +905,18 @@
         }
 
         ret = read(fd, buffer, nbytes);
-       // If we read zero bytes, the network is closed, as we returned from 
the select()
-       if (ret == 0) {
-           return -1;
-       }
+       // If we read zero bytes, the network may be closed, as we returned 
from the select()
+        if (ret == -1) {
+            log_error (_("The socket for fd #%d was never available for 
reading data"), fd);
+            return -1;
+        }
+
+        if (ret == 0) {
+           if (_debug) {
+               log_debug (_("The socket for #fd %d timed out waiting to read 
data"), fd);
+           }
+            return 0;
+        }
        
        if (_debug) {
            log_debug (_("read %d bytes from fd #%d from port %d"), ret, fd, 
_port);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]