/[mldonkey]/mldonkey/src/utils/net/tcpClientSocket.ml
ViewVC logotype

Diff of /mldonkey/src/utils/net/tcpClientSocket.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by simon_mld, Thu Nov 20 16:43:27 2003 UTC revision 1.4 by spiralvoice, Mon Jun 20 18:38:49 2005 UTC
# Line 108  end; Line 108  end;
108        t.wfbuf.buf <- "";        t.wfbuf.buf <- "";
109        close t.sock (Printf.sprintf "%s after %d/%d" s t.nread t.nwrite)        close t.sock (Printf.sprintf "%s after %d/%d" s t.nread t.nwrite)
110      with e ->      with e ->
111          lprintf "Exception %s in TcpBufferedSocket.close"          lprintf "Exception %s in TcpBufferedSocket.close\n"
112            (Printexc2.to_string e); lprint_newline ();            (Printexc2.to_string e);
113          raise e          raise e
114    end    end
115        
# Line 120  let shutdown t s = Line 120  let shutdown t s =
120  end;  end;
121    *)    *)
122    (try BasicSocket.shutdown t.sock s with e ->    (try BasicSocket.shutdown t.sock s with e ->
123         lprintf "exception %s in shutdown" (Printexc2.to_string e);         lprintf "exception %s in shutdown\n" (Printexc2.to_string e));
         lprint_newline () );  
124    (try close t s with  e ->    (try close t s with  e ->
125          lprintf "exception %s in shutdown" (Printexc2.to_string e);          lprintf "exception %s in shutdown\n" (Printexc2.to_string e))
         lprint_newline ())  
126    
127  let buf_create max =  let buf_create max =
128    {    {
# Line 212  let buf_add t b s pos1 len = Line 210  let buf_add t b s pos1 len =
210        end        end
211      else      else
212      if b.len + len > b.max_buf_size then begin      if b.len + len > b.max_buf_size then begin
213          lprintf "BUFFER OVERFLOW %d+%d> %d" b.len len b.max_buf_size ;          lprintf "BUFFER OVERFLOW %d+%d> %d\n" b.len len b.max_buf_size ;
         lprint_newline ();  
214                    
215          lprintf "MESSAGE [";          lprintf "MESSAGE [";
216          for i = pos1 to pos1 + (mini len 20) - 1 do          for i = pos1 to pos1 + (mini len 20) - 1 do
217            lprintf "(%d)" (int_of_char s.[i]);            lprintf "(%d)" (int_of_char s.[i]);
218          done;          done;
219          if len > 20 then lprintf "...";          if len > 20 then lprintf "...";
220          lprintf "]"; lprint_newline ();          lprintf "]\n";
221                    
222          t.event_handler t BUFFER_OVERFLOW;          t.event_handler t BUFFER_OVERFLOW;
223        end        end
# Line 536  let dump_socket t buf = Line 533  let dump_socket t buf =
533        
534  let create name fd handler =  let create name fd handler =
535    if !debug then begin    if !debug then begin
536        lprintf "[fd %d %s]" (Obj.magic fd) name; lprint_newline ();        lprintf "[fd %d %s]\n" (Obj.magic fd) name;
537      end;      end;
538    MlUnix.set_close_on_exec fd;    MlUnix.set_close_on_exec fd;
539    let t = {    let t = {
# Line 605  let connect name host port handler = Line 602  let connect name host port handler =
602      with      with
603        Unix.Unix_error((Unix.EINPROGRESS|Unix.EINTR),_,_) -> t        Unix.Unix_error((Unix.EINPROGRESS|Unix.EINTR),_,_) -> t
604      | e ->      | e ->
605          lprintf "For host %s port %d" (Unix.string_of_inet_addr host)          lprintf "For host %s port %d\n"
606          port; lprint_newline ();            (Unix.string_of_inet_addr host) port;
607          close t "connect failed";          close t "connect failed";
608          raise e          raise e
609    with e ->    with e ->
610        lprintf "+++ Exception BEFORE CONNECT %s" (Printexc2.to_string e);        lprintf "+++ Exception BEFORE CONNECT %s\n" (Printexc2.to_string e);
       lprint_newline ();  
611        raise e        raise e
612                
613        

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26