diff options
author | David Barksdale <amatus@amatus.name> | 2014-08-13 16:29:15 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-08-13 16:29:15 -0500 |
commit | 205ac4d83fc388c1e2d0bb590a2a36e9a4c2fd78 (patch) | |
tree | 1dbd529848c396058dfc9c8a4f402dcbe3546317 /net/ipv4/tcp.c | |
parent | ace6c6d243016e272050787c14e27a83ecd94a25 (diff) |
gpl-source-mybooklive-010203-update.zipgpl-source-mybooklive-010303-update.zipgpl-source-mybooklive-010203-update.zip
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 84 |
1 files changed, 77 insertions, 7 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 8b8b2766253..72fa141d17d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -610,8 +610,12 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, /* * We can't seek on a socket input */ - if (unlikely(ppos)) + if (unlikely(ppos)) { + printk(KERN_ERR "%s:%s:%d\n" + "returning ESPIPE\n", + __FUNCTION__, __FILE__, __LINE__); return -ESPIPE; + } ret = spliced = 0; @@ -620,39 +624,81 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, timeo = sock_rcvtimeo(sk, sock->file->f_flags & O_NONBLOCK); while (tss.len) { ret = __tcp_splice_read(sk, &tss); - if (ret < 0) + if (ret < 0) { + printk(KERN_ERR "%s:%s:%d\n" + "breaking err %d\n", + __FUNCTION__, __FILE__, __LINE__, ret); break; + } else if (!ret) { if (spliced >= len) break; if (flags & SPLICE_F_NONBLOCK) { ret = -EAGAIN; + printk(KERN_ERR "%s:%s:%d\n" + "breaking -EAGAIN\n", + __FUNCTION__, __FILE__, __LINE__); break; } if (sock_flag(sk, SOCK_DONE)) + { + printk(KERN_ERR "%s:%s:%d\n" + "breaking %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); break; + } if (sk->sk_err) { ret = sock_error(sk); + printk(KERN_ERR "%s:%s:%d\n" + "breaking err %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); break; } if (sk->sk_shutdown & RCV_SHUTDOWN) + { + printk(KERN_ERR "%s:%s:%d\n" + "breaking %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); break; + } if (sk->sk_state == TCP_CLOSE) { + printk(KERN_ERR "%s:%s:%d\n" + "breaking %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); /* * This occurs when user tries to read * from never connected socket. */ - if (!sock_flag(sk, SOCK_DONE)) + if (!sock_flag(sk, SOCK_DONE)) { + printk(KERN_ERR "%s:%s:%d\n" + "breaking ENOTCONN\n", + __FUNCTION__, __FILE__, __LINE__); ret = -ENOTCONN; + } break; } if (!timeo) { ret = -EAGAIN; + printk(KERN_ERR "%s:%s:%d\n" + "breaking EAGAIN\n", + __FUNCTION__, __FILE__, __LINE__); break; } sk_wait_data(sk, &timeo); - if (signal_pending(current)) { + if (signal_pending(current)) { // exists in distro-kernel ret = sock_intr_errno(timeo); + if ( spliced == 0 ) + { + printk( KERN_ERR "%s:%s:%d\n" + "signal pending recd during " + "tcp splice read .. returning %d.\n", + __FILE__, __FUNCTION__, __LINE__, + ret ); + } break; } continue; @@ -661,14 +707,38 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, spliced += ret; if (!timeo) + { + printk(KERN_ERR "%s:%s:%d\n" + "breaking %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); break; + } release_sock(sk); lock_sock(sk); if (sk->sk_err || sk->sk_state == TCP_CLOSE || - (sk->sk_shutdown & RCV_SHUTDOWN) || - signal_pending(current)) + (sk->sk_shutdown & RCV_SHUTDOWN)) + { + printk(KERN_ERR "%s:%s:%d\n" + "breaking %d\n", + __FUNCTION__, __FILE__, __LINE__, + ret); + break; + } + + if (signal_pending(current)) + { + if ( spliced == 0 ) + { + printk( KERN_ERR "%s:%s:%d\n" + "signal pending recd at end of while during " + "tcp splice read .. returning %d.\n", + __FILE__, __FUNCTION__, __LINE__, + ret ); + } break; + } } release_sock(sk); @@ -1338,7 +1408,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, sk_eat_skb(sk, skb, 0); if (!desc->count) break; - tp->copied_seq = seq; + tp->copied_seq = seq; } tp->copied_seq = seq; |