diff options
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index d23065ff..eb6b4f31 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -1645,11 +1645,11 @@ typedef enum TOX_ERR_FILE_SEND_CHUNK { | |||
1645 | */ | 1645 | */ |
1646 | TOX_ERR_FILE_SEND_CHUNK_NOT_TRANSFERRING, | 1646 | TOX_ERR_FILE_SEND_CHUNK_NOT_TRANSFERRING, |
1647 | /** | 1647 | /** |
1648 | * Attempted to send more data than requested. The requested data size is | 1648 | * Attempted to send more or less data than requested. The requested data size is |
1649 | * adjusted according to maximum transmission unit and the expected end of | 1649 | * adjusted according to maximum transmission unit and the expected end of |
1650 | * the file. Trying to send more will result in no data being sent. | 1650 | * the file. Trying to send less or more than requested will return this error. |
1651 | */ | 1651 | */ |
1652 | TOX_ERR_FILE_SEND_CHUNK_TOO_LARGE, | 1652 | TOX_ERR_FILE_SEND_CHUNK_INVALID_LENGTH, |
1653 | /** | 1653 | /** |
1654 | * Packet queue is full. | 1654 | * Packet queue is full. |
1655 | */ | 1655 | */ |
@@ -1664,12 +1664,12 @@ typedef enum TOX_ERR_FILE_SEND_CHUNK { | |||
1664 | * Send a chunk of file data to a friend. | 1664 | * Send a chunk of file data to a friend. |
1665 | * | 1665 | * |
1666 | * This function is called in response to the `file_request_chunk` callback. The | 1666 | * This function is called in response to the `file_request_chunk` callback. The |
1667 | * length parameter should be equal to or less than the one received though the | 1667 | * length parameter should be equal to the one received though the callback. |
1668 | * callback. If it is zero, the transfer is assumed complete. For files with | 1668 | * If it is zero, the transfer is assumed complete. For files with known size, |
1669 | * known size, Core will know that the transfer is complete after the last byte | 1669 | * Core will know that the transfer is complete after the last byte has been |
1670 | * has been received, so it is not necessary (though not harmful) to send a | 1670 | * received, so it is not necessary (though not harmful) to send a zero-length |
1671 | * zero-length chunk to terminate. For streams, it is necessary for the last | 1671 | * chunk to terminate. For streams, core will know that the transfer is finished |
1672 | * chunk sent to be zero-length. | 1672 | * if a chunk with length less than the length requested in the callback is sent. |
1673 | * | 1673 | * |
1674 | * @return true on success. | 1674 | * @return true on success. |
1675 | */ | 1675 | */ |
@@ -1694,10 +1694,7 @@ bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number, | |||
1694 | * In response to receiving this callback, the client should call the function | 1694 | * In response to receiving this callback, the client should call the function |
1695 | * `tox_file_send_chunk` with the requested chunk. If the number of bytes sent | 1695 | * `tox_file_send_chunk` with the requested chunk. If the number of bytes sent |
1696 | * through that function is zero, the file transfer is assumed complete. A | 1696 | * through that function is zero, the file transfer is assumed complete. A |
1697 | * client may choose to send less than requested, if it is reading from a | 1697 | * client must send the full length of data requested with this callback. |
1698 | * stream that doesn't have more data, yet, and it still wants to send some | ||
1699 | * data to the other side. However, this will generally be less efficient than | ||
1700 | * waiting for a full chunk size of data to be ready. | ||
1701 | * | 1698 | * |
1702 | * @param friend_number The friend number of the receiving friend for this file. | 1699 | * @param friend_number The friend number of the receiving friend for this file. |
1703 | * @param file_number The file transfer identifier returned by tox_file_send. | 1700 | * @param file_number The file transfer identifier returned by tox_file_send. |