Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -867,7 +867,14 @@ |
868 | 868 | if ( !$sock ) { |
869 | 869 | return; |
870 | 870 | } |
871 | | - socket_sendto( $sock, $text, strlen( $text ), 0, $host, $port ); |
| 871 | + |
| 872 | + $len = strlen( $text ); |
| 873 | + $maxLen = socket_get_option( $sock, SOL_UDP, SO_SNDBUF ); |
| 874 | + |
| 875 | + if ( $len > $maxLen ) { |
| 876 | + $len = $maxLen - 1; |
| 877 | + } |
| 878 | + socket_sendto( $sock, $text, $len, 0, $host, $port ); |
872 | 879 | socket_close( $sock ); |
873 | 880 | } else { |
874 | 881 | wfSuppressWarnings(); |