X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Fdsi%2Fdsi_cmdreply.c;h=04d17083351ea715cf89809c0cd3eb8189d4fef7;hb=e450b7b95579a4a4358e499fdbf93620aa09bae2;hp=1fb833ab7f33dd800d9ab6aaa6b7ed913ec25d33;hpb=458fcac4e6aee7eb54ba744f57169f70cce12505;p=netatalk.git diff --git a/libatalk/dsi/dsi_cmdreply.c b/libatalk/dsi/dsi_cmdreply.c index 1fb833ab..04d17083 100644 --- a/libatalk/dsi/dsi_cmdreply.c +++ b/libatalk/dsi/dsi_cmdreply.c @@ -5,21 +5,32 @@ #ifdef HAVE_CONFIG_H #include "config.h" -#endif +#endif /* HAVE_CONFIG_H */ #include +#include + #include -#include +#include /* this assumes that the reply follows right after the command, saving * on a couple assignments. specifically, command, requestID, and * reserved field are assumed to already be set. */ int dsi_cmdreply(DSI *dsi, const int err) { - dsi->header.dsi_flags = DSIFL_REPLY; - /*dsi->header.dsi_command = DSIFUNC_CMD;*/ - dsi->header.dsi_len = htonl(dsi->datalen); - dsi->header.dsi_code = htonl(err); + int ret; + + LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): START", + dsi->clientID, dsi->datalen); + + dsi->header.dsi_flags = DSIFL_REPLY; + dsi->header.dsi_len = htonl(dsi->datalen); + dsi->header.dsi_data.dsi_code = htonl(err); + + ret = dsi_stream_send(dsi, dsi->data, dsi->datalen); + + LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): END", + dsi->clientID, dsi->datalen); - return dsi_stream_send(dsi, dsi->data, dsi->datalen); + return ret; }