summaryrefslogtreecommitdiff
path: root/security/nss/lib/libpkix/pkix_pl_nss/module
diff options
context:
space:
mode:
authorkaie%kuix.de <devnull@localhost>2011-08-10 12:31:54 +0000
committerkaie%kuix.de <devnull@localhost>2011-08-10 12:31:54 +0000
commite5929e9ab193b24c0df82cbd1eb2a0cc9eb3e64b (patch)
treeb48934242ed404f5843cab4563606ddfd5cba130 /security/nss/lib/libpkix/pkix_pl_nss/module
parent28d1913427f9228ec32eadd7dd4c8b28a62bfe25 (diff)
downloadnss-hg-e5929e9ab193b24c0df82cbd1eb2a0cc9eb3e64b.tar.gz
Bug 676886, NSS' internal HTTP client should exclude :port for OCSP requests on default port 80, r=wtc
Diffstat (limited to 'security/nss/lib/libpkix/pkix_pl_nss/module')
-rw-r--r--security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
index 1bd0a5a38..c9c24743d 100644
--- a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
+++ b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c
@@ -1350,6 +1350,7 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
PKIX_UInt32 postLen = 0;
PRPollDesc *pollDesc = NULL;
char *sendbuf = NULL;
+ char portstr[16];
PKIX_ENTER
(HTTPDEFAULTCLIENT,
@@ -1393,13 +1394,19 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
client->rcv_http_data = http_response_data;
/* prepare the message */
+ portstr[0] = '\0';
+ if (client->portnum != 80) {
+ PR_snprintf(portstr, sizeof(portstr), ":%d",
+ client->portnum);
+ }
+
if (client->send_http_method == HTTP_POST_METHOD) {
sendbuf = PR_smprintf
- ("POST %s HTTP/1.0\r\nHost: %s:%d\r\n"
+ ("POST %s HTTP/1.0\r\nHost: %s%s\r\n"
"Content-Type: %s\r\nContent-Length: %u\r\n\r\n",
client->path,
client->host,
- client->portnum,
+ portstr,
client->send_http_content_type,
client->send_http_data_len);
postLen = PORT_Strlen(sendbuf);
@@ -1427,10 +1434,10 @@ pkix_pl_HttpDefaultClient_TrySendAndReceive(
} else if (client->send_http_method == HTTP_GET_METHOD) {
client->GETBuf = PR_smprintf
- ("GET %s HTTP/1.1\r\nHost: %s:%d\r\n\r\n",
+ ("GET %s HTTP/1.0\r\nHost: %s%s\r\n\r\n"
client->path,
client->host,
- client->portnum);
+ portstr);
client->GETLen = PORT_Strlen(client->GETBuf);
}