From 5907777153932e27805b192443dfe2845327a8c4 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Thu, 12 Aug 2010 21:45:31 +0200 Subject: curl -T: ignore file size of special files original bug report at https://bugzilla.redhat.com/622520 --- RELEASE-NOTES | 2 +- src/main.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d33314b00..080e572e9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -9,7 +9,7 @@ Curl and libcurl 7.21.2 This release includes the following changes: - o + o curl -T: ignore file size of special files This release includes the following bugfixes: diff --git a/src/main.c b/src/main.c index 5585c1755..3b78d602f 100644 --- a/src/main.c +++ b/src/main.c @@ -4925,7 +4925,10 @@ operate(struct Configurable *config, int argc, argv_item_t argv[]) goto quit_urls; } infdopen=TRUE; - uploadfilesize=fileinfo.st_size; + + /* we ignore file size for char/block devices, sockets, etc. */ + if(S_IFREG == (fileinfo.st_mode & S_IFMT)) + uploadfilesize=fileinfo.st_size; } else if(uploadfile && stdin_upload(uploadfile)) { -- cgit v1.2.3