[kio] [Bug 291835] KIO very slow when copying from network through smb

oliver at openbrackets.net oliver at openbrackets.net
Fri Dec 23 18:33:46 GMT 2016


https://bugs.kde.org/show_bug.cgi?id=291835

--- Comment #45 from oliver at openbrackets.net <oliver at openbrackets.net> ---
I think we can safely assume that the SMB protocol is not just "a socket".
Obviously no-one wants to re-implement an SMB protocol client, that would be a
huge task. 

So it's really a question of whether libsmbclient (or similar lib) can support
"just being fed data from an FD". From all I have seen, that is not the case.
libsmbclient expects discrete calls to smbc_read|write:

/**@ingroup file
 * Read from a file using an opened file handle.
 *
 * @param fd        Open file handle from smbc_open() or smbc_creat()
 *
 * @param buf       Pointer to buffer to receive read data
 *
 * @param bufsize   Size of buf in bytes
 *
 * @return          Number of bytes read;
 *                  0 upon EOF;
 *                  < 0 on error, with errno set:
 *                  - EISDIR fd refers to a directory
 *                  - EBADF  fd  is  not  a valid file descriptor or
 *                    is not open for reading.
 *                  - EINVAL fd is attached to an object which is
 *                    unsuitable for reading, or no buffer passed or
 *                    smbc_init not called.
 *
 * @see             smbc_open(), smbc_write()
 *
 */
ssize_t smbc_read(int fd, void *buf, size_t bufsize);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list