o (HTTP) Expect: header disabling work better
o (HTTP) "Expect: 100-continue" disable on second POST on re-used connection
o src/config.h.in is fixed
+ o (HTTP) POST data logged to the debug callback function is now correctly
+ tagged as data, not header
Other curl-related news:
Domenico Andreoli, Armel Asselin, Gisle Vanem, Yang Tse, Andrew Biggs,
Peter Sylvester, David McCreedy, Dmitriy Sergeyev, Dmitry Rechkin,
Jari Sundell, Ravi Pratap, Michele Bini, Jeff Pohlmeyer, Michael Wallner,
- Mike Protts, Cory Nelson, Bernard Leak, Bogdan Nicula
+ Mike Protts, Cory Nelson, Bernard Leak, Bogdan Nicula, Dan Fandrich
Thanks! (and sorry if I forgot to mention someone)
start++;
/*
- * Here we check if we want the specific single authentiction (using ==) and
+ * Here we check if we want the specific single authentication (using ==) and
* if we do, we initiate usage of it.
*
* If the provided authentication is wanted as one out of several accepted
- * types (using &), we OR this authenticaion type to the authavail
+ * types (using &), we OR this authentication type to the authavail
* variable.
*/
}
/*
- * add_buffer_send() sends a buffer and frees all associated memory.
+ * add_buffer_send() sends a header buffer and frees all associated memory.
+ * Body data may be appended to the header data if desired.
*
* Returns CURLcode
*/
struct connectdata *conn,
long *bytes_written, /* add the number of sent
bytes to this counter */
+ int included_body_bytes, /* how much of the buffer
+ contains body data (for log tracing) */
int socketindex)
+
{
ssize_t amount;
CURLcode res;
if(CURLE_OK == res) {
- if(conn->data->set.verbose)
+ if(conn->data->set.verbose) {
/* this data _may_ contain binary stuff */
- Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr, amount, conn);
+ Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr,
+ amount-included_body_bytes, conn);
+ if (included_body_bytes)
+ Curl_debug(conn->data, CURLINFO_DATA_OUT,
+ ptr+amount-included_body_bytes, included_body_bytes, conn);
+ }
*bytes_written += amount;
if(CURLE_OK == result)
/* Now send off the request */
result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, sockindex);
+ &data->info.request_size, 0, sockindex);
}
if(result)
failf(data, "Failed sending CONNECT to proxy");
/* If we are not using a proxy and we want a secure connection, perform SSL
* initialization & connection now. If using a proxy with https, then we
* must tell the proxy to CONNECT to the host we want to talk to. Only
- * after the connect has occured, can we start talking SSL
+ * after the connect has occurred, can we start talking SSL
*/
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
char *request;
Curl_HttpReq httpreq = data->set.httpreq;
char *addcookies = NULL;
+ int included_body = 0;
/* Always consider the DO phase done after this function call, even if there
may be parts of the request that is not yet sent, since we can deal with
else
http = data->reqdata.proto.http;
- /* We default to persistant connections */
+ /* We default to persistent connections */
conn->bits.close = FALSE;
if ( (conn->protocol&(PROT_HTTP|PROT_FTP)) &&
return result;
result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, FIRSTSOCKET);
+ &data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending POST request");
else
/* fire away the whole request to the server */
result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, FIRSTSOCKET);
+ &data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending POST request");
else
/* this sends the buffer and frees all the buffer resources */
result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, FIRSTSOCKET);
+ &data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending PUT request");
else
already now to reduce the number if send() calls */
result = add_buffer(req_buffer, data->set.postfields,
(size_t)postsize);
+ included_body = postsize;
}
else {
/* Append the POST data chunky-style */
result = add_buffer(req_buffer,
"\r\n0\r\n\r\n", 7); /* end of a chunked
transfer stream */
+ included_body = postsize + 7;
}
if(result)
return result;
}
}
/* issue the request */
- result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, FIRSTSOCKET);
+ result = add_buffer_send(req_buffer, conn, &data->info.request_size,
+ included_body, FIRSTSOCKET);
if(result)
failf(data, "Failed sending HTTP POST request");
/* issue the request */
result = add_buffer_send(req_buffer, conn,
- &data->info.request_size, FIRSTSOCKET);
+ &data->info.request_size, 0, FIRSTSOCKET);
if(result)
failf(data, "Failed sending HTTP request");
* own.
*/
static const char * const s_infotype[] = {
- "*", "<", ">"
+ "*", "<", ">", "{", "}", "{", "}"
};
size_t i;
size_t st=0;
static bool newl = FALSE;
+ static bool traced_data = FALSE;
switch(type) {
case CURLINFO_HEADER_OUT:
if(!newl)
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
fwrite(data+st, i-st+1, 1, config->trace_stream);
+ newl = (bool)(size && (data[size-1] != '\n'));
+ traced_data = FALSE;
break;
case CURLINFO_TEXT:
case CURLINFO_HEADER_IN:
if(!newl)
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
fwrite(data, size, 1, config->trace_stream);
+ newl = (bool)(size && (data[size-1] != '\n'));
+ traced_data = FALSE;
+ break;
+ case CURLINFO_DATA_OUT:
+ case CURLINFO_DATA_IN:
+ case CURLINFO_SSL_DATA_IN:
+ case CURLINFO_SSL_DATA_OUT:
+ if(!traced_data) {
+ if(!newl)
+ fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
+ fprintf(config->trace_stream, "[data not shown]\n");
+ newl = FALSE;
+ traced_data = TRUE;
+ }
break;
default: /* nada */
newl = FALSE;
+ traced_data = FALSE;
break;
}
- newl = (bool)(size && (data[size-1] != '\n'));
-
return 0;
}