case CURLINFO_HTTP_CODE:
*param_longp = data->progress.httpcode;
break;
+ case CURLINFO_HEADER_SIZE:
+ *param_longp = data->header_size;
+ break;
+ case CURLINFO_REQUEST_SIZE:
+ *param_longp = data->request_size;
+ break;
case CURLINFO_TOTAL_TIME:
*param_doublep = data->progress.timespent;
break;
return CURLE_WRITE_ERROR;
}
}
+ data->header_size += p - data->headerbuff;
break; /* exit header line loop */
}
return CURLE_WRITE_ERROR;
}
}
+ data->header_size += hbuflen;
/* reset hbufp pointer && hbuflen */
hbufp = data->headerbuff;
/* set upload size to the progress meter */
pgrsSetUploadSize(data, http->postsize);
- add_buffer_send(data->firstsocket, conn, req_buffer);
+ data->request_size =
+ add_buffer_send(data->firstsocket, conn, req_buffer);
result = Transfer(conn, data->firstsocket, -1, TRUE,
&http->readbytecount,
data->firstsocket,
pgrsSetUploadSize(data, data->infilesize);
/* this sends the buffer and frees all the buffer resources */
- add_buffer_send(data->firstsocket, conn, req_buffer);
+ data->request_size =
+ add_buffer_send(data->firstsocket, conn, req_buffer);
/* prepare for transfer */
result = Transfer(conn, data->firstsocket, -1, TRUE,
else
add_buffer(req_buffer, "\r\n", 2);
+ /* issue the request */
+ data->request_size =
+ add_buffer_send(data->firstsocket, conn, req_buffer);
+
/* HTTP GET/HEAD download: */
- add_buffer_send(data->firstsocket, conn, req_buffer);
result = Transfer(conn, data->firstsocket, -1, TRUE, bytecount,
-1, NULL); /* nothing to upload */
}
the same we read from. -1 disables */
long *writebytecountp; /* return number of bytes written or NULL */
-
#ifdef KRB4
enum protection_level command_prot;
proxy string features a ":[port]" that one will override
this. */
+
+ long header_size; /* size of read header(s) in bytes */
+ long request_size; /* the amount of bytes sent in the request(s) */
+
/*************** Request - specific items ************/
union {
char *headerbuff; /* allocated buffer to store headers in */
int headersize; /* size of the allocation */
+#if 0
+ /* this was removed in libcurl 7.4 */
char *writeinfo; /* if non-NULL describes what to output on a successful
completion */
+#endif
struct Progress progress;