s3: Lift smbd_server_fd() from read_data()
authorVolker Lendecke <vl@samba.org>
Sun, 15 Aug 2010 13:30:21 +0000 (15:30 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Aug 2010 20:44:03 +0000 (22:44 +0200)
All callers have appropriate debug messages themselves

source3/lib/util_sock.c
source3/smbd/reply.c

index b61a3f703e81a2a65037cd8b4a0548d9ea25a7d0..74a3e343acdcd64e2dbf6b79bf0b54909be5dc02 100644 (file)
@@ -531,25 +531,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
 
 NTSTATUS read_data(int fd, char *buffer, size_t N)
 {
-       NTSTATUS status;
-
-       status = read_fd_with_timeout(fd, buffer, N, N, 0, NULL);
-       if (NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-       if (fd == smbd_server_fd()) {
-               char addr[INET6_ADDRSTRLEN];
-               /* Try and give an error message
-                * saying what client failed. */
-               DEBUG(0, ("read_fd_with_timeout failed for "
-                         "client %s read error = %s.\n",
-                         get_peer_addr(fd,addr,sizeof(addr)),
-                         nt_errstr(status)));
-       } else {
-               DEBUG(0, ("read_fd_with_timeout failed, read error = %s.\n",
-                         nt_errstr(status)));
-       }
-       return status;
+       return read_fd_with_timeout(fd, buffer, N, N, 0, NULL);
 }
 
 /****************************************************************************
index a2b6b33af5af7f2dbf649b17c35bf1dabbfc86f8..18d198fe0fae53a5c09c2bc4dc892f6c7768e054 100644 (file)
@@ -3966,9 +3966,14 @@ void reply_writebraw(struct smb_request *req)
                status = read_data(req->sconn->sock, buf+4, numtowrite);
 
                if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(0,("reply_writebraw: Oversize secondary write "
-                                "raw read failed (%s). Terminating\n",
-                                nt_errstr(status)));
+                       char addr[INET6_ADDRSTRLEN];
+                       /* Try and give an error message
+                        * saying what client failed. */
+                       DEBUG(0, ("reply_writebraw: Oversize secondary write "
+                                 "raw read failed (%s) for client %s. "
+                                 "Terminating\n", nt_errstr(status),
+                                 get_peer_addr(req->sconn->sock, addr,
+                                               sizeof(addr))));
                        exit_server_cleanly("secondary writebraw failed");
                }