nw_Recieve will call the above function to read data out of the socket. It will then determine which of the buffers we should use and pass to the routine which called us
| 940 | // nw_Recieve will call the above function to read data out of the socket. It will then determine |
| 941 | // which of the buffers we should use and pass to the routine which called us |
| 942 | int nw_Receive(void *data, network_address *from_addr) { |
| 943 | // call the routine to read data out of the socket (which stuffs it into the packet buffers) |
| 944 | |
| 945 | if (Use_DirectPlay) { |
| 946 | #ifdef WIN32 |
| 947 | dp_DirectPlayDispatch(); |
| 948 | #endif |
| 949 | } else { |
| 950 | // nw_ReceiveFromSocket(); |
| 951 | nw_DoReceiveCallbacks(); |
| 952 | } |
| 953 | |
| 954 | int buffer_size; |
| 955 | |
| 956 | // try and get a free buffer and return its size |
| 957 | if (nw_psnet_buffer_get_next((uint8_t *)data, &buffer_size, from_addr)) { |
| 958 | return buffer_size; |
| 959 | } |
| 960 | return 0; |
| 961 | } |
| 962 | |
| 963 | int ExtraBufferTempHack = 0; |
| 964 | // Temp hack to figure out this buffer overflow thing |
no test coverage detected