summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-27 15:32:39 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-27 15:32:39 +0200
commit980e2112cf7a987df40b3157a417ad0e3a831476 (patch)
treee447c8095073e225102360ccbfce8a42eda83f4d /pflocal
parent69bd9b1d600debf7b758cc7f8353b747430259b4 (diff)
Add MSG_PEEK support to pflocal
* libpipe/pq.h (packet_peek): Declare new function. * libpipe/pq.c (packet_read): Move code to new `packet_fetch' function, call it with `remove' set to 1. (packet_fetch): New function with code from `packet_read', but do not remove data if `remove' is 0. (packet_peek): New function, calls `packet_fetch' with `remove' set to 0. * libpipe/dgram.c (dgram_read): When MSG_PEEK is in *flags, do not dequeue and only peek data. * libpipe/seqpack.c (seqpack_read): Likewise. * libpipe/stream.c (stream_read): Likewise. * pflocal/socket.c (S_socket_recv): Pass MSG_PEEK flag to libpipe.
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c
index 2684a7234..a0e5b1da6 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -372,7 +372,7 @@ S_socket_recv (struct sock_user *user,
return EINVAL; /* XXX */
/* Fill in the pipe FLAGS from any corresponding ones in IN_FLAGS. */
- flags = 0;
+ flags = in_flags & MSG_PEEK;
err = sock_acquire_read_pipe (user->sock, &pipe);
if (err == EPIPE)