Create a gist now

Instantly share code, notes, and snippets.

--- MongoDB-0.26/xs/Connection.xs 2009-11-05 17:19:25.000000000 -0800
+++ MongoDB-0.26/xs/Connection.xs.patched 2009-12-04 12:37:10.000000000 -0800
@@ -186,11 +186,25 @@
mongo_link *link;
CODE:
link = (mongo_link*)perl_mongo_get_ptr_from_instance(self);
+
if (link->paired) {
+#ifdef WIN32
+ closesocket(link->server.pair.left_socket);
+ closesocket(link->server.pair.right_socket);
+#else
+ close(link->server.pair.left_socket);
+ close(link->server.pair.right_socket);
+#endif
Safefree(link->server.pair.left_host);
Safefree(link->server.pair.right_host);
}
else {
+#ifdef WIN32
+ closesocket(link->server.single.socket);
+#else
+ close(link->server.single.socket);
+#endif
Safefree(link->server.single.host);
}
+
Safefree(link);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment