/*
- * $Id: http.cc,v 1.272 1998/05/20 23:35:01 wessels Exp $
+ * $Id: http.cc,v 1.273 1998/05/21 22:01:08 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
* used by httpBuildRequestPrefix()
* note: calls httpHeaderInit(), the caller is responsible for Clean()-ing
*/
-static void
+void
httpBuildRequestHeader(request_t * request,
request_t * orig_request,
StoreEntry * entry,
extern void httpAnonInitModule();
extern int httpAnonHdrAllowed(http_hdr_type hdr_id);
extern int httpAnonHdrDenied(http_hdr_type hdr_id);
+extern void httpBuildRequestHeader(request_t *, request_t *, StoreEntry *, HttpHeader *, int, int);
/* Http Status Line */
/* init/clean */
/*
- * $Id: ssl.cc,v 1.77 1998/03/31 05:37:49 wessels Exp $
+ * $Id: ssl.cc,v 1.78 1998/05/21 22:01:08 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
sslProxyConnected(int fd, void *data)
{
SslStateData *sslState = data;
+ MemBuf mb;
+ HttpHeader hdr_out;
+ Packer p;
debug(26, 3) ("sslProxyConnected: FD %d sslState=%p\n", fd, sslState);
- snprintf(sslState->client.buf, SQUID_TCP_SO_RCVBUF,
- "CONNECT %s HTTP/1.0\r\n\r\n", sslState->url);
- debug(26, 3) ("sslProxyConnected: Sending '%s'\n", sslState->client.buf);
- sslState->client.len = strlen(sslState->client.buf);
+ memBufDefInit(&mb);
+ memBufPrintf(&mb, "CONNECT %s HTTP/1.0\r\n", sslState->url);
+ httpBuildRequestHeader(sslState->request,
+ sslState->request,
+ NULL, /* StoreEntry */
+ &hdr_out,
+ sslState->client.fd,
+ 0); /* flags */
+ packerToMemInit(&p, &mb);
+ httpHeaderPackInto(&hdr_out, &p);
+ httpHeaderClean(&hdr_out);
+ packerClean(&p);
+ memBufAppend(&mb, "\r\n", 2);
+ xstrncpy(sslState->client.buf, mb.buf, SQUID_TCP_SO_RCVBUF);
+ debug(26, 3) ("sslProxyConnected: Sending {%s}\n", sslState->client.buf);
+ sslState->client.len = mb.size;
sslState->client.offset = 0;
+ memBufClean(&mb);
commSetSelect(sslState->server.fd,
COMM_SELECT_WRITE,
sslWriteServer,
/*
- * $Id: tunnel.cc,v 1.77 1998/03/31 05:37:49 wessels Exp $
+ * $Id: tunnel.cc,v 1.78 1998/05/21 22:01:08 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
sslProxyConnected(int fd, void *data)
{
SslStateData *sslState = data;
+ MemBuf mb;
+ HttpHeader hdr_out;
+ Packer p;
debug(26, 3) ("sslProxyConnected: FD %d sslState=%p\n", fd, sslState);
- snprintf(sslState->client.buf, SQUID_TCP_SO_RCVBUF,
- "CONNECT %s HTTP/1.0\r\n\r\n", sslState->url);
- debug(26, 3) ("sslProxyConnected: Sending '%s'\n", sslState->client.buf);
- sslState->client.len = strlen(sslState->client.buf);
+ memBufDefInit(&mb);
+ memBufPrintf(&mb, "CONNECT %s HTTP/1.0\r\n", sslState->url);
+ httpBuildRequestHeader(sslState->request,
+ sslState->request,
+ NULL, /* StoreEntry */
+ &hdr_out,
+ sslState->client.fd,
+ 0); /* flags */
+ packerToMemInit(&p, &mb);
+ httpHeaderPackInto(&hdr_out, &p);
+ httpHeaderClean(&hdr_out);
+ packerClean(&p);
+ memBufAppend(&mb, "\r\n", 2);
+ xstrncpy(sslState->client.buf, mb.buf, SQUID_TCP_SO_RCVBUF);
+ debug(26, 3) ("sslProxyConnected: Sending {%s}\n", sslState->client.buf);
+ sslState->client.len = mb.size;
sslState->client.offset = 0;
+ memBufClean(&mb);
commSetSelect(sslState->server.fd,
COMM_SELECT_WRITE,
sslWriteServer,