253 |
peer_kind := kind) |
peer_kind := kind) |
254 |
| _ -> |
| _ -> |
255 |
if !verbose_hidden_errors then |
if !verbose_hidden_errors then |
256 |
lprintf "Unused source tag [%s]\n" |
lprintf_nl "Unused source tag [%s]" |
257 |
(escaped_string_of_field tag) |
(escaped_string_of_field tag) |
258 |
) r_tags; |
) r_tags; |
259 |
{ |
{ |
395 |
magic <> kademlia_packed_header_code) then |
magic <> kademlia_packed_header_code) then |
396 |
begin |
begin |
397 |
if !CommonOptions.verbose_unknown_messages then begin |
if !CommonOptions.verbose_unknown_messages then begin |
398 |
lprintf "Received unknown UDP packet\n"; |
lprintf_nl "Received unknown UDP packet"; |
399 |
dump pbuf; |
dump pbuf; |
400 |
end; |
end; |
401 |
raise Not_found |
raise Not_found |
432 |
|
|
433 |
if !verbose_overnet then |
if !verbose_overnet then |
434 |
begin |
begin |
435 |
lprintf "Sending UDP to %s:%d type %s (opcode 0x%02X len %d)\n" |
lprintf_nl "Sending UDP to %s:%d type %s (opcode 0x%02X len %d)" |
436 |
(Ip.to_string ip) port (message_to_string msg) (get_uint8 s 1) |
(Ip.to_string ip) port (message_to_string msg) (get_uint8 s 1) |
437 |
(String.length s); |
(String.length s); |
438 |
(*dump s; lprint_newline ();*) |
(*dump s; lprint_newline ();*) |
448 |
UdpSocket.write sock ping s ip port |
UdpSocket.write sock ping s ip port |
449 |
with |
with |
450 |
| MessageNotImplemented -> () |
| MessageNotImplemented -> () |
451 |
| e -> lprintf "Exception %s in udp_send\n" (Printexc2.to_string e) |
| e -> lprintf_nl "Exception %s in udp_send" (Printexc2.to_string e) |
452 |
|
|
453 |
let udp_handler f sock event = |
let udp_handler f sock event = |
454 |
match event with |
match event with |
468 |
with e -> |
with e -> |
469 |
if !verbose_hidden_errors then |
if !verbose_hidden_errors then |
470 |
begin |
begin |
471 |
lprintf "Error %s in udp_handler, dump of packet:\n" |
lprintf_nl "Error %s in udp_handler, dump of packet:" |
472 |
(Printexc2.to_string e); |
(Printexc2.to_string e); |
473 |
dump p.UdpSocket.udp_content; |
dump p.UdpSocket.udp_content; |
474 |
lprint_newline () |
lprintf_nl "" |
475 |
end |
end |
476 |
); |
); |
477 |
| _ -> () |
| _ -> () |