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

Function inet_write

src/remote/inet.cpp:2890–2925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2888}
2889
2890static bool inet_write(RemoteXdr* xdrs)
2891{
2892/**************************************
2893 *
2894 * i n e t _ w r i t e
2895 *
2896 **************************************
2897 *
2898 * Functional description
2899 * Write a buffer full of data.
2900 *
2901 **************************************/
2902 // Encode the data portion of the packet
2903
2904 rem_port* port = xdrs->x_public;
2905 const char* p = xdrs->x_base;
2906 USHORT length = xdrs->x_private - p;
2907
2908 // Send data in manageable hunks. If a packet is partial, indicate
2909 // that with a negative length. A positive length marks the end.
2910
2911 while (length)
2912 {
2913 const SSHORT l = (SSHORT) MIN(length, INET_remote_buffer);
2914 length -= l;
2915 if (!packet_send(port, p, (SSHORT) (length ? -l : l)))
2916 return false;
2917 p += l;
2918 }
2919
2920 xdrs->x_private = xdrs->x_base;
2921 xdrs->x_handy = INET_remote_buffer;
2922
2923 return true;
2924
2925}
2926
2927#ifdef DEBUG
2928static void packet_print(const TEXT* string, const UCHAR* packet, int length, ULONG counter)

Callers

nothing calls this directly

Calls 1

packet_sendFunction · 0.85

Tested by

no test coverage detected