webclient: Always use "connection: close" for HTTP 1.1 for now
* This matches the HTTP 1.0 behavior. * Persistent connection doesn't make much sense with the current API.
This commit is contained in:
parent
7949059ec2
commit
092ce81444
@ -240,14 +240,15 @@ static const char g_httpuseragentfields[] =
|
|||||||
CONFIG_NSH_WGET_USERAGENT
|
CONFIG_NSH_WGET_USERAGENT
|
||||||
"\r\n\r\n";
|
"\r\n\r\n";
|
||||||
|
|
||||||
static const char g_httpcrnl[] = "\r\n";
|
static const char g_httpcrnl[] = "\r\n";
|
||||||
|
|
||||||
static const char g_httpform[] = "Content-Type: "
|
static const char g_httpform[] = "Content-Type: "
|
||||||
"application/x-www-form-urlencoded";
|
"application/x-www-form-urlencoded";
|
||||||
static const char g_httpcontsize[] = "Content-Length: ";
|
static const char g_httpcontsize[] = "Content-Length: ";
|
||||||
|
static const char g_httpconn_close[] = "Connection: close";
|
||||||
#if 0
|
#if 0
|
||||||
static const char g_httpconn[] = "Connection: Keep-Alive";
|
static const char g_httpconn[] = "Connection: Keep-Alive";
|
||||||
static const char g_httpcache[] = "Cache-Control: no-cache";
|
static const char g_httpcache[] = "Cache-Control: no-cache";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -1156,6 +1157,14 @@ int webclient_perform(FAR struct webclient_context *ctx)
|
|||||||
dest = append(dest, ep, g_httpcrnl);
|
dest = append(dest, ep, g_httpcrnl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->protocol_version == WEBCLIENT_PROTOCOL_VERSION_HTTP_1_1)
|
||||||
|
{
|
||||||
|
/* We don't implement persistect connections. */
|
||||||
|
|
||||||
|
dest = append(dest, ep, g_httpconn_close);
|
||||||
|
dest = append(dest, ep, g_httpcrnl);
|
||||||
|
}
|
||||||
|
|
||||||
dest = append(dest, ep, g_httpuseragentfields);
|
dest = append(dest, ep, g_httpuseragentfields);
|
||||||
|
|
||||||
if (dest == NULL)
|
if (dest == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user