Sep 16 20:07:28 10.0.2.193 apache2[28441]: PHP Warning: socket_sendto() [<a href='function.socket-sendto'>function.socket-sendto</a>]: unable to write to socket [90]: Message too long in /home/wikipedia/common/php-1.17-test/includes/GlobalFunctions.php on line 464
Sep 16 20:07:29 10.0.2.193 apache2[26511]: PHP Warning: socket_sendto() [<a href='function.socket-sendto'>function.socket-sendto</a>]: unable to write to socket [90]: Message too long in /home/wikipedia/common/php-1.17-test/includes/GlobalFunctions.php on line 464
if ( !$sock ) {
return;
}
- socket_sendto( $sock, $text, strlen( $text ), 0, $host, $port );
+
+ $len = strlen( $text );
+ $maxLen = socket_get_option( $sock, SOL_UDP, SO_SNDBUF );
+
+ if ( $len > $maxLen ) {
+ $len = $maxLen - 1;
+ }
+ socket_sendto( $sock, $text, $len, 0, $host, $port );
socket_close( $sock );
} else {
wfSuppressWarnings();