[socket] Fix send() const-correctness to match POSIX

send() takes void* but should be const void* to match POSIX and
the class's own write()/sendto() signatures.
This commit is contained in:
J. Nick Koston
2026-03-01 07:46:32 -10:00
parent fe89d7c701
commit d1b1090f93
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ class BSDSocketImpl {
return ::write(this->fd_, buf, len);
#endif
}
ssize_t send(void *buf, size_t len, int flags) { return ::send(this->fd_, buf, len, flags); }
ssize_t send(const void *buf, size_t len, int flags) { return ::send(this->fd_, buf, len, flags); }
ssize_t writev(const struct iovec *iov, int iovcnt) {
#if defined(USE_ESP32)
return ::lwip_writev(this->fd_, iov, iovcnt);
@@ -57,7 +57,7 @@ class LwIPSocketImpl {
}
ssize_t readv(const struct iovec *iov, int iovcnt) { return lwip_readv(this->fd_, iov, iovcnt); }
ssize_t write(const void *buf, size_t len) { return lwip_write(this->fd_, buf, len); }
ssize_t send(void *buf, size_t len, int flags) { return lwip_send(this->fd_, buf, len, flags); }
ssize_t send(const void *buf, size_t len, int flags) { return lwip_send(this->fd_, buf, len, flags); }
ssize_t writev(const struct iovec *iov, int iovcnt) { return lwip_writev(this->fd_, iov, iovcnt); }
ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) {
return lwip_sendto(this->fd_, buf, len, flags, to, tolen);