summaryrefslogtreecommitdiff
path: root/ext/socket/rubysocket.h
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2022-09-20 16:10:56 +0200
committerJean Boussier <jean.boussier@gmail.com>2023-08-30 10:07:18 +0200
commitbcc905100f1079e191632cfd02319c10af82dac0 (patch)
treee8dbe37eb4de741c51210f65ffaa0336ce579c8a /ext/socket/rubysocket.h
parentacedbcb1b4eb6b362f11e783bff53c237d05afc6 (diff)
BasicSocket#recv* return `nil` rather than an empty packet
[Bug #19012] man recvmsg(2) states: > Return Value > These calls return the number of bytes received, or -1 if an error occurred. > The return value will be 0 when the peer has performed an orderly shutdown. Not too sure how one is supposed to make the difference between a packet of size 0 and a closed connection.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6407
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r--ext/socket/rubysocket.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 5f803ba0da..7c5739808d 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -459,6 +459,8 @@ VALUE rsock_write_nonblock(VALUE sock, VALUE buf, VALUE ex);
void rsock_make_fd_nonblock(int fd);
+int rsock_is_dgram(rb_io_t *fptr);
+
#if !defined HAVE_INET_NTOP && ! defined _WIN32
const char *inet_ntop(int, const void *, char *, size_t);
#elif defined __MINGW32__