summaryrefslogtreecommitdiff
path: root/src/tool_writeout.h
Commit message (Collapse)AuthorAgeFilesLines
* http: add support to read and store the referrer headerViktor Szakats2021-02-191-1/+2
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* tool_writeout: refactor write-out and write-out jsonJay Satiro2021-02-091-15/+6
| | | | | | | | | | | | | | | | | | | | | - Deduplicate the logic used by write-out and write-out json. Rather than have separate writeLong, writeString, etc, logic for each of write-out and write-out json instead have respective shared functions that can output either format and a 'use_json' parameter to indicate whether it is json that is output. This will make it easier to maintain. Rather than have to go through two sets of logic now we only have to go through one. - Support write-out %{errormsg} and %{exitcode} in json. - Clarify in the doc that %{exitcode} is the exit code of the transfer. Prior to this change it just said "The numerical exitcode" which implies it's the exit code of the tool, and it's not necessarily that. Closes https://github.com/curl/curl/pull/6544
* curl: add variables to --write-outDaniel Stenberg2020-12-211-28/+34
| | | | | | | | | | | | | | | | | | | | | In particular, these ones can help a user to create its own error message when one or transfers fail. writeout: add 'onerror', 'url', 'urlnum', 'exitcode', 'errormsg' onerror - lets a user only show the rest on non-zero exit codes url - the input URL used for this transfer urlnum - the numerical URL counter (0 indexed) for this transfer exitcode - the numerical exit code for the transfer errormsg - obvious Reported-by: Earnestly on github Fixes #6199 Closes #6207
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* tool_writeout: add new writeout variable, %{num_headers}anio2020-09-151-1/+3
| | | | | | This variable gives the number of headers. Closes #5947
* curl: add %{method} to the -w variablesDaniel Stenberg2020-07-141-0/+1
| | | | | | Gets the CURLINFO_EFFECTIVE_METHOD from libcurl. Added test 1197 to verify.
* writeout_json: Fix data type issuesMichael Kaufmann2020-03-271-0/+1
| | | | | | | | | | | | | | | Load long values correctly (e.g. for http_code). Use curl_off_t (not long) for: - size_download (CURLINFO_SIZE_DOWNLOAD_T) - size_upload (CURLINFO_SIZE_UPLOAD_T) The unit for these values is bytes/second, not microseconds: - speed_download (CURLINFO_SPEED_DOWNLOAD_T) - speed_upload (CURLINFO_SPEED_UPLOAD_T) Fixes #5131 Closes #5152
* writeout: support to generate JSON outputMathias Gumz2020-03-171-1/+56
| | | | | | | | | | | | | | | | This commit adds support to generate JSON via the writeout feature: -w "%{json}" It leverages the existing infrastructure as much as possible. Thus, generating the JSON on STDERR is possible by: -w "%{stderr}%{json}" This implements a variant of https://github.com/curl/curl/wiki/JSON#--write-out-json. Closes #4870
* copyrights: fix copyright year rangeDaniel Stenberg2019-11-081-1/+1
| | | | | | | | .. because checksrc's copyright year check stopped working. Ref: https://github.com/curl/curl/pull/4547 Closes https://github.com/curl/curl/pull/4549
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* curl tool: use configuration files from lib directoryYang Tse2012-04-061-2/+2
| | | | | | | | | | | Configuration files such as curl_config.h and all config-*.h no longer exist nor are generated/copied into 'src' directory, now these only exist in 'lib' directory from where curl tool sources uses them. Additionally old src/setup.h has been refactored into src/tool_setup.h which now pulls lib/setup.h The possibility of a makefile needing an include path adjustment exists.
* curl tool: add filename_effective token for --write-outDave Reisner2012-04-011-1/+1
| | | | | | | By modifying the parameter list for ourWriteOut() and passing the OutStruct that collects data in tool_operate, we get access to the remote name that we're writing to. Shell scripters should find this useful when used in conjuntion with the --remote-header-name option.
* curl tool: reviewed code moved to tool_*.[ch] filesYang Tse2011-10-061-0/+28