This is an automated email from the ASF dual-hosted git repository.
jvanderzee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new fc5918e5a8 Update InkAPITest.cc for new `con.sock` field (#11674)
fc5918e5a8 is described below
commit fc5918e5a8bb1eb88b98689c463c3574a64e8bef
Author: JosiahWI <[email protected]>
AuthorDate: Tue Aug 13 09:37:36 2024 -0500
Update InkAPITest.cc for new `con.sock` field (#11674)
* Constify buffer parameters on socket write methods
* Update InkAPITest.cc for new `con.sock` field
---
include/iocore/eventsystem/UnixSocket.h | 14 +++++++-------
src/api/InkAPITest.cc | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/iocore/eventsystem/UnixSocket.h
b/include/iocore/eventsystem/UnixSocket.h
index a770e5d8cb..08cbdb7bd1 100644
--- a/include/iocore/eventsystem/UnixSocket.h
+++ b/include/iocore/eventsystem/UnixSocket.h
@@ -84,10 +84,10 @@ public:
int recvmmsg(struct mmsghdr *msgvec, int vlen, int flags, struct timespec
*timeout) const;
#endif
- std::int64_t write(void *buf, int size) const;
+ std::int64_t write(void const *buf, int size) const;
- int send(void *buf, int size, int flags) const;
- int sendto(void *buf, int size, int flags, struct sockaddr const *to, int
tolen) const;
+ int send(void const *buf, int size, int flags) const;
+ int sendto(void const *buf, int size, int flags, struct sockaddr const *to,
int tolen) const;
int sendmsg(struct msghdr const *m, int flags) const;
static int poll(struct pollfd *fds, unsigned long nfds, int timeout);
@@ -203,7 +203,7 @@ UnixSocket::recvmmsg(struct mmsghdr *msgvec, int vlen, int
flags, struct timespe
#endif
inline std::int64_t
-UnixSocket::write(void *buf, int size) const
+UnixSocket::write(void const *buf, int size) const
{
std::int64_t r;
do {
@@ -216,11 +216,11 @@ UnixSocket::write(void *buf, int size) const
}
inline int
-UnixSocket::send(void *buf, int size, int flags) const
+UnixSocket::send(void const *buf, int size, int flags) const
{
int r;
do {
- if (unlikely((r = ::send(this->fd, static_cast<char *>(buf), size, flags))
< 0)) {
+ if (unlikely((r = ::send(this->fd, static_cast<char const *>(buf), size,
flags)) < 0)) {
r = -errno;
}
} while (r == -EINTR);
@@ -228,7 +228,7 @@ UnixSocket::send(void *buf, int size, int flags) const
}
inline int
-UnixSocket::sendto(void *buf, int len, int flags, struct sockaddr const *to,
int tolen) const
+UnixSocket::sendto(void const *buf, int len, int flags, struct sockaddr const
*to, int tolen) const
{
int r;
do {
diff --git a/src/api/InkAPITest.cc b/src/api/InkAPITest.cc
index f2c818f7d3..63876b6b15 100644
--- a/src/api/InkAPITest.cc
+++ b/src/api/InkAPITest.cc
@@ -1454,7 +1454,7 @@ client_handler(TSCont contp, TSEvent event, void *data)
// happen until data arrives on the socket. Because we're just testing the
accept()
// we write a small amount of ignored data to make sure this gets
triggered.
UnixNetVConnection *vc = static_cast<UnixNetVConnection *>(data);
- ink_release_assert(::write(vc->con.fd, "Bob's your uncle", 16) != 0);
+ ink_release_assert(vc->con.sock.write("Bob's your uncle", 16) != 0);
sleep(1); // XXX this sleep ensures the server end gets the accept event.