mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-25 05:51:55 -08:00
Merge branch 'fix-udp-socket-receive' into 'develop'
Fix socket-receive to match the documentation; set MSG_TRUNC when socket type is :datagram See merge request embeddable-common-lisp/ecl!162
This commit is contained in:
commit
bcf1c3bba7
1 changed files with 6 additions and 5 deletions
|
|
@ -491,18 +491,19 @@ safe_buffer_pointer(cl_object x, cl_index size)
|
|||
(unless (or buffer length) (error "You have to supply either buffer or length!"))
|
||||
(let ((buffer (or buffer (make-array length :element-type element-type)))
|
||||
(length (or length (length buffer)))
|
||||
(fd (socket-file-descriptor socket)))
|
||||
(fd (socket-file-descriptor socket))
|
||||
(trunc (if (eql (socket-type socket) :datagram) t nil)))
|
||||
|
||||
(multiple-value-bind (len-recv errno)
|
||||
(c-inline (fd buffer length
|
||||
oob peek waitall)
|
||||
(:int :object :int :bool :bool :bool)
|
||||
(c-inline (fd buffer length oob peek waitall trunc)
|
||||
(:int :object :int :bool :bool :bool :bool)
|
||||
(values :long :int)
|
||||
"
|
||||
{
|
||||
int flags = ( #3 ? MSG_OOB : 0 ) |
|
||||
( #4 ? MSG_PEEK : 0 ) |
|
||||
( #5 ? MSG_WAITALL : 0 );
|
||||
( #5 ? MSG_WAITALL : 0 ) |
|
||||
( #6 ? MSG_TRUNC : 0 );
|
||||
cl_type type = ecl_t_of(#1);
|
||||
ssize_t len;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue