MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / inet_error

Function inet_error

src/remote/inet.cpp:2638–2698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2636
2637
2638static void inet_error(bool releasePort, rem_port* port, const TEXT* function, ISC_STATUS operation, int status)
2639{
2640/**************************************
2641 *
2642 * i n e t _ e r r o r
2643 *
2644 **************************************
2645 *
2646 * Functional description
2647 * An I/O error has occurred. Call
2648 * inet_gen_error with the appropriate args
2649 * to format the status vector if any.
2650 *
2651 **************************************/
2652 if (status)
2653 {
2654 if (port->port_state == rem_port::PENDING)
2655 {
2656 string err;
2657 err.printf("INET/inet_error: %s errno = %d", function, status);
2658
2659 if (port->port_peer_name.hasData() || port->port_address.hasData())
2660 {
2661 err.append(port->port_flags & PORT_async ? ", aux " : ", ");
2662 err.append(port->port_server_flags ? "client" : "server");
2663
2664 if (port->port_peer_name.hasData())
2665 {
2666 err.append(" host = ");
2667 err.append(port->port_peer_name);
2668 }
2669
2670 if (port->port_address.hasData())
2671 {
2672 if (port->port_peer_name.hasData())
2673 err.append(",");
2674
2675 err.append(" address = ");
2676 err.append(port->port_address);
2677 }
2678 }
2679
2680 if (port->port_user_name.hasData())
2681 {
2682 err.append(", user = ");
2683 err.append(port->port_user_name);
2684 }
2685
2686 // Address could contain percent sign inside, therefore make
2687 // sure error string not used as printf format string.
2688 gds__log("%s", err.c_str());
2689 }
2690
2691 inet_gen_error(releasePort, port, Arg::Gds(operation) << SYS_ERR(status));
2692 }
2693 else
2694 {
2695 // No status value, just format the basic arguments.

Callers 10

INET_connectFunction · 0.85
listener_socketFunction · 0.85
alloc_portFunction · 0.85
aux_connectFunction · 0.85
aux_requestFunction · 0.85
select_acceptFunction · 0.85
inet_try_connectFunction · 0.85
packet_receiveFunction · 0.85
packet_sendFunction · 0.85
inet.cppFile · 0.85

Calls 6

inet_gen_errorFunction · 0.85
GdsClass · 0.85
printfMethod · 0.45
hasDataMethod · 0.45
appendMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected