mochiweb style avoidance of gen_tcp:controlling_process

TODO: remove extraneous debug_rlogs


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666431 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/alterl/src/thrift_protocol.erl b/lib/alterl/src/thrift_protocol.erl
index f1b2bcc..484dcd4 100644
--- a/lib/alterl/src/thrift_protocol.erl
+++ b/lib/alterl/src/thrift_protocol.erl
@@ -5,6 +5,7 @@
          read/2,
          skip/2,
          flush_transport/1,
+         close_transport/1,
          typeid_to_atom/1
         ]).
 
@@ -19,7 +20,8 @@
     [
      {read, 2},
      {write, 2},
-     {flush_transport, 1}
+     {flush_transport, 1},
+     {close_transport, 1}
     ];
 behaviour_info(_Else) -> undefined.
 
@@ -31,6 +33,10 @@
                           data = Data}) ->
     Module:flush_transport(Data).
 
+close_transport(#protocol{module = Module,
+                          data = Data}) ->
+    Module:close_transport(Data).
+
 typeid_to_atom(?tType_STOP) -> field_stop;
 typeid_to_atom(?tType_VOID) -> void;
 typeid_to_atom(?tType_BOOL) -> bool;