break;
default:
+ SILC_LOG_DEBUG(("Unknown request type %d", req->type));
break;
}
void *context)
{
SilcSFTPClient sftp = context;
- unsigned char inbuf[30720];
+ unsigned char inbuf[33792];
SilcBufferStruct packet;
int ret;
return;
}
+ SILC_LOG_DEBUG(("Read %d bytes", ret));
+
/* Now process the SFTP packet */
silc_buffer_set(&packet, inbuf, ret);
silc_sftp_client_receive_process(context, &packet);
/* Parse the packet */
type = silc_sftp_packet_decode(buffer, &payload, &payload_len);
- if (!type)
+ if (type <= 0)
return;
silc_buffer_set(&buf, payload, payload_len);
void *context)
{
SilcSFTPServer sftp = context;
- unsigned char inbuf[30720];
+ unsigned char inbuf[33792];
SilcBufferStruct packet;
int ret;
/* Parse the packet */
type = silc_sftp_packet_decode(buffer, &payload, &payload_len);
- if (!type)
+ if (type <= 0)
return;
silc_buffer_set(&buf, payload, payload_len);
/* Decodes the SFTP packet data `packet' and return the SFTP packet type.
The payload of the packet is returned to the `payload' pointer. Returns
- 0 if error occurred during decoding. */
+ 0 if error occurred during decoding and -1 if partial packet was
+ received. */
SilcSFTPPacket silc_sftp_packet_decode(SilcBuffer packet,
unsigned char **payload,
return 0;
if (len > (silc_buffer_len(packet) - 5))
- return 0;
+ return -1;
silc_buffer_pull(packet, 5);
ret = silc_buffer_unformat(packet,
* DESCRIPTION
*
* Shutdown's the SFTP client. The caller is responsible of closing
- * the associated socket connection. The SFTP context is freed and is
- * invalid after this function returns.
+ * the associated stream. The SFTP context is freed and is invalid after
+ * this function returns.
*
***/
void silc_sftp_client_shutdown(SilcSFTP sftp);
*
* DESCRIPTION
*
- * Shutdown's the SFTP server. The caller is responsible of closing
- * the associated socket connection. The SFTP context is freed and is
- * invalid after this function returns.
+ * Shutdown the SFTP server. The caller is responsible of closing the
+ * associated stream. The SFTP context is freed and is invalid after
+ * this function returns.
*
***/
void silc_sftp_server_shutdown(SilcSFTP sftp);
*
* This structure includes the monitor type specific data. The
* application can check what the client has requested from this
- * structure.
+ * structure. See the comments below what data is available for what
+ * monitor type.
*
* SOURCE
*/