• Home
  • Raw
  • Download

Lines Matching +full:linkify +full:- +full:it

21  * SPDX-License-Identifier: curl
53 bold-off code (21) isn't supported everywhere - like in the mac
74 struct HdrCbData *hdrcbdata = &per->hdrcbdata; in tool_header_cb()
75 struct OutStruct *outs = &per->outs; in tool_header_cb()
76 struct OutStruct *heads = &per->heads; in tool_header_cb()
77 struct OutStruct *etag_save = &per->etag_save; in tool_header_cb()
83 if(!per->config) in tool_header_cb()
88 warnf(per->config->global, "Header data exceeds single call write limit"); in tool_header_cb()
94 /* Discard incomplete UTF-8 sequence buffered from body */ in tool_header_cb()
95 if(outs->utf8seq[0]) in tool_header_cb()
96 memset(outs->utf8seq, 0, sizeof(outs->utf8seq)); in tool_header_cb()
100 * Write header data when curl option --dump-header (-D) is given. in tool_header_cb()
103 if(per->config->headerfile && heads->stream) { in tool_header_cb()
104 size_t rc = fwrite(ptr, size, nmemb, heads->stream); in tool_header_cb()
108 (void)fflush(heads->stream); in tool_header_cb()
111 curl_easy_getinfo(per->curl, CURLINFO_SCHEME, &scheme); in tool_header_cb()
115 curl_easy_getinfo(per->curl, CURLINFO_RESPONSE_CODE, &response); in tool_header_cb()
121 * Write etag to file when --etag-save option is given. in tool_header_cb()
123 else if(per->config->etag_save_file && etag_save->stream && in tool_header_cb()
127 const char *eot = end - 1; in tool_header_cb()
132 eot--; in tool_header_cb()
135 size_t etag_length = eot - etag_h + 1; in tool_header_cb()
137 * Truncate the etag save stream, it can have an existing etag value. in tool_header_cb()
140 if(ftruncate(fileno(etag_save->stream), 0)) { in tool_header_cb()
144 if(fseek(etag_save->stream, 0, SEEK_SET)) { in tool_header_cb()
149 fwrite(etag_h, size, etag_length, etag_save->stream); in tool_header_cb()
151 fputc('\n', etag_save->stream); in tool_header_cb()
152 (void)fflush(etag_save->stream); in tool_header_cb()
159 * curl options --remote-name (-O) and --remote-header-name (-J) have in tool_header_cb()
161 * Content-Disposition header specifying a filename property. in tool_header_cb()
164 else if(hdrcbdata->honor_cd_filename && in tool_header_cb()
165 (cb > 20) && checkprefix("Content-disposition:", str)) { in tool_header_cb()
176 if(p > end - 9) in tool_header_cb()
190 len = cb - (size_t)(p - str); in tool_header_cb()
193 if(outs->stream) { in tool_header_cb()
199 if(per->config->output_dir) { in tool_header_cb()
200 outs->filename = aprintf("%s/%s", per->config->output_dir, in tool_header_cb()
203 if(!outs->filename) in tool_header_cb()
207 outs->filename = filename; in tool_header_cb()
209 outs->is_cd_filename = TRUE; in tool_header_cb()
210 outs->s_isreg = TRUE; in tool_header_cb()
211 outs->fopened = FALSE; in tool_header_cb()
212 outs->alloc_filename = TRUE; in tool_header_cb()
213 hdrcbdata->honor_cd_filename = FALSE; /* done now! */ in tool_header_cb()
214 if(!tool_create_output_file(outs, per->config)) in tool_header_cb()
219 if(!outs->stream && !tool_create_output_file(outs, per->config)) in tool_header_cb()
223 if(hdrcbdata->config->writeout) { in tool_header_cb()
226 if(per->was_last_header_empty) in tool_header_cb()
227 per->num_headers = 0; in tool_header_cb()
228 per->was_last_header_empty = FALSE; in tool_header_cb()
229 per->num_headers++; in tool_header_cb()
232 per->was_last_header_empty = TRUE; in tool_header_cb()
234 if(hdrcbdata->config->show_headers && in tool_header_cb()
240 if(!outs->stream && !tool_create_output_file(outs, per->config)) in tool_header_cb()
243 if(hdrcbdata->global->isatty && in tool_header_cb()
247 hdrcbdata->global->styled_output) in tool_header_cb()
250 size_t namelen = value - ptr; in tool_header_cb()
251 fprintf(outs->stream, BOLD "%.*s" BOLDOFF ":", (int)namelen, ptr); in tool_header_cb()
253 fwrite(&value[1], cb - namelen - 1, 1, outs->stream); in tool_header_cb()
256 write_linked_location(per->curl, &value[1], cb - namelen - 1, in tool_header_cb()
257 outs->stream); in tool_header_cb()
260 fwrite(&value[1], cb - namelen - 1, 1, outs->stream); in tool_header_cb()
264 /* not "handled", just show it */ in tool_header_cb()
265 fwrite(ptr, cb, 1, outs->stream); in tool_header_cb()
347 * named CURL_TESTDIR to prefix the given file name to put it into a in parse_filename()
401 --llen; in write_linked_location()
405 /* Strip the trailing end-of-line characters, normally "\r\n" */ in write_linked_location()
406 while(llen && (loc[llen-1] == '\n' || loc[llen-1] == '\r')) in write_linked_location()
407 --llen; in write_linked_location()
409 /* CURLU makes it easy to handle the relative URL case */ in write_linked_location()
414 /* Create a NUL-terminated and whitespace-stripped copy of Location: */ in write_linked_location()
444 (int)loclen - space_skipped, loc); in write_linked_location()
448 /* Not a "safe" URL: don't linkify it */ in write_linked_location()