/[mldonkey]/mldonkey/src/networks/donkey/donkeyProtoCom.ml
ViewVC logotype

Diff of /mldonkey/src/networks/donkey/donkeyProtoCom.ml

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

revision 1.21 by spiralvoice, Fri Jul 22 14:32:12 2005 UTC revision 1.22 by spiralvoice, Tue Sep 6 11:24:59 2005 UTC
# Line 47  let lprintf_n () = Line 47  let lprintf_n () =
47  let buf = TcpBufferedSocket.internal_buf  let buf = TcpBufferedSocket.internal_buf
48    
49  let client_msg_to_string emule_version msg =  let client_msg_to_string emule_version msg =
50    Buffer.clear buf;    Buffer.reset buf;
51    buf_int8 buf 0;    buf_int8 buf 0;
52    buf_int buf 0;    buf_int buf 0;
53    let magic = DonkeyProtoClient.write emule_version buf msg in    let magic = DonkeyProtoClient.write emule_version buf msg in
# Line 58  let client_msg_to_string emule_version m Line 58  let client_msg_to_string emule_version m
58    s    s
59    
60  let server_msg_to_string msg =  let server_msg_to_string msg =
61    Buffer.clear buf;    Buffer.reset buf;
62    buf_int8 buf 227;    buf_int8 buf 227;
63    buf_int buf 0;    buf_int buf 0;
64    DonkeyProtoServer.write buf msg;    DonkeyProtoServer.write buf msg;
# Line 178  let udp_send t ip port msg = Line 178  let udp_send t ip port msg =
178      end;      end;
179    
180    try    try
181      Buffer.clear buf;      Buffer.reset buf;
182      DonkeyProtoUdp.write buf msg;      DonkeyProtoUdp.write buf msg;
183      let s = Buffer.contents buf in      let s = Buffer.contents buf in
184      UdpSocket.write t false s ip port      UdpSocket.write t false s ip port
# Line 338  let server_send_share compressed sock ms Line 338  let server_send_share compressed sock ms
338      !!client_buffer_size - 100      !!client_buffer_size - 100
339        - TcpBufferedSocket.remaining_to_write sock        - TcpBufferedSocket.remaining_to_write sock
340    in    in
341    Buffer.clear buf;    Buffer.reset buf;
342    let s =    let s =
343        buf_int buf 0;        buf_int buf 0;
344        let nfiles, prev_len =        let nfiles, prev_len =
# Line 351  let server_send_share compressed sock ms Line 351  let server_send_share compressed sock ms
351        let s = String.sub s 0 prev_len in        let s = String.sub s 0 prev_len in
352        if !verbose_share then        if !verbose_share then
353           lprintf_nl () "Sending %d share(s) to server : " nfiles;           lprintf_nl () "Sending %d share(s) to server : " nfiles;
354        Buffer.clear buf;        Buffer.reset buf;
355        let s_c =        let s_c =
356          if compressed && Autoconf.has_zlib then          if compressed && Autoconf.has_zlib then
357            Autoconf.zlib__compress_string s            Autoconf.zlib__compress_string s
# Line 388  let server_send_share compressed sock ms Line 388  let server_send_share compressed sock ms
388  let client_send_files sock msg =  let client_send_files sock msg =
389    let max_len = !!client_buffer_size - 100 -    let max_len = !!client_buffer_size - 100 -
390      TcpBufferedSocket.remaining_to_write sock in      TcpBufferedSocket.remaining_to_write sock in
391    Buffer.clear buf;    Buffer.reset buf;
392    buf_int8 buf 227;    buf_int8 buf 227;
393    buf_int buf 0;    buf_int buf 0;
394    buf_int8 buf 75; (* ViewFilesReply *)    buf_int8 buf 75; (* ViewFilesReply *)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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