Added debug info when zero length octet string is received.
This commit is contained in:
@@ -132,12 +132,16 @@ static void AtomicReadFileAckHandler(
|
|||||||
SEEK_SET);
|
SEEK_SET);
|
||||||
octets_written = fwrite(octetstring_value(&data.fileData), 1, /* unit to write in bytes - in our case, an octet is one byte */
|
octets_written = fwrite(octetstring_value(&data.fileData), 1, /* unit to write in bytes - in our case, an octet is one byte */
|
||||||
octetstring_length(&data.fileData), pFile);
|
octetstring_length(&data.fileData), pFile);
|
||||||
if (octets_written != octetstring_length(&data.fileData))
|
if (octets_written != octetstring_length(&data.fileData)) {
|
||||||
fprintf(stderr, "Unable to write data to file \"%s\".\n",
|
fprintf(stderr, "Unable to write data to file \"%s\".\n",
|
||||||
Local_File_Name);
|
Local_File_Name);
|
||||||
else
|
} else if (octets_written == 0) {
|
||||||
|
fprintf(stderr, "Received 0 byte octet string!.\n");
|
||||||
|
} else {
|
||||||
printf("\r%u bytes",
|
printf("\r%u bytes",
|
||||||
(data.type.stream.fileStartPosition + octets_written));
|
(data.type.stream.fileStartPosition + octets_written));
|
||||||
|
}
|
||||||
|
fflush(pFile);
|
||||||
fclose(pFile);
|
fclose(pFile);
|
||||||
}
|
}
|
||||||
if (data.endOfFile) {
|
if (data.endOfFile) {
|
||||||
|
|||||||
Reference in New Issue
Block a user