• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/curl/curl-7.36.0/lib/

Lines Matching refs:data

48  * blocks of data.  Remaining, bare CRs are changed to LFs.  The possibly new
49 * size of the data is returned.
51 static size_t convert_lineends(struct SessionHandle *data,
61 if(data->state.prev_block_had_trailing_cr) {
62 /* The previous block of incoming data
65 /* This block of incoming data starts with the
70 data->state.crlf_conversions++;
72 data->state.prev_block_had_trailing_cr = FALSE; /* reset the flag */
86 data->state.crlf_conversions++;
108 data->state.prev_block_had_trailing_cr = TRUE;
117 /* tidy up by null terminating the now shorter data */
128 void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
130 if(data && data->set.verbose) {
138 Curl_debug(data, CURLINFO_TEXT, print_buffer, len, NULL);
146 void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
152 vsnprintf(data->state.buffer, BUFSIZE, fmt, ap);
154 if(data->set.errorbuffer && !data->state.errorbuf) {
155 snprintf(data->set.errorbuffer, CURL_ERROR_SIZE, "%s", data->state.buffer);
156 data->state.errorbuf = TRUE; /* wrote error string */
158 if(data->set.verbose) {
159 len = strlen(data->state.buffer);
161 data->state.buffer[len] = '\n';
162 data->state.buffer[++len] = '\0';
164 Curl_debug(data, CURLINFO_TEXT, data->state.buffer, len, NULL);
170 /* Curl_sendf() sends formated data to the server */
174 struct SessionHandle *data = conn->data;
198 if(data->set.verbose)
199 Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written, conn);
217 * Curl_write() is an internal write function that sends data to the
272 due to its inability to send off data without blocking. We therefor
282 failf(conn->data, "Send failure: %s",
284 conn->data->state.os_errno = err;
292 * Curl_write_plain() is an internal write function that sends data to the
329 due to its inability to send off data without blocking. We therefor
338 failf(conn->data, "Recv failure: %s",
340 conn->data->state.os_errno = err;
347 static CURLcode pausewrite(struct SessionHandle *data,
348 int type, /* what type of data */
352 /* signalled to pause sending on this connection, but since we have data
355 struct SingleRequest *k = &data->req;
363 data->state.tempwrite = dupl;
364 data->state.tempwritesize = len;
365 data->state.tempwritetype = type;
370 DEBUGF(infof(data, "Pausing with %zu bytes in buffer for type %02x\n",
377 /* Curl_client_write() sends data to the write callback(s)
382 If CURL_DO_LINEEND_CONV is enabled, data is converted IN PLACE to the
384 the future to leave the original data alone.
391 struct SessionHandle *data = conn->data;
397 /* If reading is actually paused, we're forced to append this chunk of data
398 to the already held data, but only if it is the same type as otherwise it
400 if(data->req.keepon & KEEP_RECV_PAUSE) {
403 if(type != data->state.tempwritetype)
407 DEBUGASSERT(data->state.tempwrite);
409 /* figure out the new size of the data to save */
410 newlen = len + data->state.tempwritesize;
412 newptr = realloc(data->state.tempwrite, newlen);
415 /* copy the new data to the end of the new area */
416 memcpy(newptr + data->state.tempwritesize, ptr, len);
418 data->state.tempwrite = newptr;
419 data->state.tempwritesize = newlen;
428 CURLcode rc = Curl_convert_from_network(data, ptr, len);
435 len = convert_lineends(data, ptr, len);
438 /* If the previous block of data ended with CR and this block of data is
441 wrote = data->set.fwrite_func(ptr, 1, len, data->set.out);
452 failf(data, "Write callback asked for PAUSE when not supported!");
456 return pausewrite(data, type, ptr, len);
459 failf(data, "Failed writing body (%zu != %zu)", wrote, len);
465 (data->set.fwrite_header || data->set.writeheader) ) {
471 data->set.fwrite_header?data->set.fwrite_header:data->set.fwrite_func;
476 wrote = writeit(ptr, 1, len, data->set.writeheader);
481 return pausewrite(data, CLIENTWRITE_HEADER, ptr, len);
484 failf (data, "Failed writing header");
522 CURLcode Curl_read(struct connectdata *conn, /* connection data */
524 char *buf, /* store read data here */
532 bool pipelining = Curl_multi_pipeline_enabled(conn->data->multi);
546 /* Copy from our master buffer first if we have some unread data there*/
555 /* If we come here, it means that there is no data to read from the buffer,
562 conn->data->set.buffer_size ?
563 conn->data->set.buffer_size : BUFSIZE);
583 static int showit(struct SessionHandle *data, curl_infotype type,
596 /* copy the data into my buffer so the original is unchanged */
604 * contains both headers and data (separated by CRLFCRLF).
605 * We want to convert just the headers, leaving the data as-is.
618 Curl_convert_from_network(data, buf, conv_size);
629 if(data->set.fdebug)
630 return (*data->set.fdebug)(data, type, ptr, size,
631 data->set.debugdata);
637 fwrite(s_infotype[type], 2, 1, data->set.err);
638 fwrite(ptr, size, 1, data->set.err);
641 /* we had untranslated data so we need an explicit newline */
642 fwrite("\n", 1, 1, data->set.err);
652 int Curl_debug(struct SessionHandle *data, curl_infotype type,
657 if(data->set.printhost && conn && conn->host.dispname) {
679 rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
684 rc = showit(data, type, ptr, size);