Socket: Fix handle.state() on invalid handles
[senf.git] / Socket / ClientSocketHandle.cti
index 079229d..76e6d73 100644 (file)
@@ -377,7 +377,11 @@ template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::state(SocketStateMap & map, unsigned lod)
 {
     map["handle"] = prettyName(typeid(*this));
-    this->body().state(map, lod);
+    if (this->valid()) {
+        map["valid"] << "true";
+        this->body().state(map,lod);
+    } else
+        map["valid"] << "false";
 }
 
 template <class SPolicy>