/*
- * $Id: http.cc,v 1.163 1997/05/22 17:28:51 wessels Exp $
+ * $Id: http.cc,v 1.164 1997/05/23 05:20:57 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
debug(11, 3, "proxyhttpStart: \"%s %s\"\n",
RequestMethodStr[orig_request->method], entry->url);
debug(11, 10, "proxyhttpStart: HTTP request header:\n%s\n",
- entry->mem_obj->mime_hdr);
+ entry->mem_obj->request_hdr);
if (e->options & NEIGHBOR_PROXY_ONLY)
#if DONT_USE_VM
storeReleaseRequest(entry);
storeLockObject(entry);
httpState = xcalloc(1, sizeof(HttpStateData));
httpState->entry = entry;
- httpState->req_hdr = entry->mem_obj->mime_hdr;
- httpState->req_hdr_sz = entry->mem_obj->mime_hdr_sz;
+ httpState->req_hdr = entry->mem_obj->request_hdr;
+ httpState->req_hdr_sz = entry->mem_obj->request_hdr_sz;
request = get_free_request_t();
httpState->request = requestLink(request);
httpState->neighbor = e;
}
void
-httpStart(request_t * request,
- char *req_hdr,
- int req_hdr_sz,
- StoreEntry * entry)
+httpStart(request_t * request, StoreEntry * entry)
{
int fd;
HttpStateData *httpState;
debug(11, 3, "httpStart: \"%s %s\"\n",
RequestMethodStr[request->method], entry->url);
- debug(11, 10, "httpStart: req_hdr '%s'\n", req_hdr);
/* Create socket. */
fd = comm_open(SOCK_STREAM,
0,
storeLockObject(entry);
httpState = xcalloc(1, sizeof(HttpStateData));
httpState->entry = entry;
- httpState->req_hdr = req_hdr;
- httpState->req_hdr_sz = req_hdr_sz;
+ httpState->req_hdr = entry->mem_obj->request_hdr;
+ httpState->req_hdr_sz = entry->mem_obj->request_hdr_sz;
httpState->request = requestLink(request);
httpState->fd = fd;
comm_add_close_handler(httpState->fd,
/*
- * $Id: squid.h,v 1.116 1997/05/22 15:51:59 wessels Exp $
+ * $Id: squid.h,v 1.117 1997/05/23 05:21:00 wessels Exp $
*
* AUTHOR: Duane Wessels
*
extern void start_announce _PARAMS((void *unused));
extern void sslStart _PARAMS((int fd, const char *, request_t *, char *, int *sz));
-extern void waisStart _PARAMS((method_t, char *, StoreEntry *));
+extern void waisStart _PARAMS((method_t, StoreEntry *));
extern void storeDirClean _PARAMS((void *unused));
extern void passStart _PARAMS((int fd,
const char *url,
/*
- * $Id: store.cc,v 1.240 1997/05/22 23:16:40 wessels Exp $
+ * $Id: store.cc,v 1.241 1997/05/23 05:21:02 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
debug(20, 3, "destroy_MemObject: destroying %p\n", mem);
destroy_MemObjectData(mem);
safe_free(mem->clients);
- safe_free(mem->mime_hdr);
+ safe_free(mem->request_hdr);
safe_free(mem->reply);
safe_free(mem->e_abort_msg);
requestUnlink(mem->request);
meta_data.url_strings += strlen(url);
e->method = method;
if (req_hdr) {
- mem->mime_hdr_sz = req_hdr_sz;
- mem->mime_hdr = xmalloc(req_hdr_sz + 1);
- xmemcpy(mem->mime_hdr, req_hdr, req_hdr_sz);
- *(mem->mime_hdr + req_hdr_sz) = '\0';
+ mem->request_hdr_sz = req_hdr_sz;
+ mem->request_hdr = xmalloc(req_hdr_sz + 1);
+ xmemcpy(mem->request_hdr, req_hdr, req_hdr_sz);
+ *(mem->request_hdr + req_hdr_sz) = '\0';
}
if (BIT_TEST(flags, REQ_CACHABLE)) {
BIT_SET(e->flag, ENTRY_CACHABLE);
/* Append incoming data from a primary server to an entry. */
void
-storeAppend(StoreEntry * e, const char *data, int len)
+storeAppend(StoreEntry * e, const char *buf, int len)
{
- MemObject *mem;
- /* sanity check */
- if (e == NULL) {
- debug_trap("storeAppend: NULL entry.");
- return;
- } else if ((mem = e->mem_obj) == NULL) {
- debug_trap("storeAppend: NULL entry->mem_obj");
- return;
- } else if (mem->data == NULL) {
- debug_trap("storeAppend: NULL entry->mem_obj->data");
- return;
- }
+ MemObject *mem = e->mem_obj;
+ assert(mem != NULL);
+ assert(len >= 0);
if (len) {
debug(20, 5, "storeAppend: appending %d bytes for '%s'\n", len, e->key);
storeGetMemSpace(len);
storeStartDeleteBehind(e);
}
store_mem_size += len;
- (void) memAppend(mem->data, data, len);
+ memAppend(mem->data, buf, len);
mem->e_current_len += len;
}
if (e->store_status != STORE_ABORTED && !BIT_TEST(e->flag, DELAY_SENDING))
{
debug(20, 3, "storeComplete: '%s'\n", e->key);
e->object_len = e->mem_obj->e_current_len;
- InvokeHandlers(e);
e->lastref = squid_curtime;
e->store_status = STORE_OK;
storeSetMemStatus(e, IN_MEMORY);
e->swap_status = NO_SWAP;
- safe_free(e->mem_obj->mime_hdr);
+ InvokeHandlers(e);
+ safe_free(e->mem_obj->request_hdr);
if (BIT_TEST(e->flag, RELEASE_REQUEST))
storeRelease(e);
else if (storeCheckSwapable(e))
/*
- * $Id: wais.cc,v 1.70 1997/05/15 23:38:02 wessels Exp $
+ * $Id: wais.cc,v 1.71 1997/05/23 05:21:04 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
method_t method;
char *relayhost;
int relayport;
- char *mime_hdr;
+ char *request_hdr;
char request[MAX_URL];
int ip_lookup_pending;
} WaisStateData;
if (Method)
len += strlen(Method);
- if (waisState->mime_hdr)
- len += strlen(waisState->mime_hdr);
+ if (waisState->request_hdr)
+ len += strlen(waisState->request_hdr);
buf = xcalloc(1, len + 1);
- if (waisState->mime_hdr)
+ if (waisState->request_hdr)
sprintf(buf, "%s %s %s\r\n", Method, waisState->request,
- waisState->mime_hdr);
+ waisState->request_hdr);
else
sprintf(buf, "%s %s\r\n", Method, waisState->request);
debug(24, 6, "waisSendRequest: buf: %s\n", buf);
}
void
-waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
+waisStart(method_t method, StoreEntry * entry)
{
WaisStateData *waisState = NULL;
int fd;
char *url = entry->url;
debug(24, 3, "waisStart: \"%s %s\"\n", RequestMethodStr[method], url);
- debug(24, 4, " header: %s\n", mime_hdr);
if (!Config.Wais.relayHost) {
debug(24, 0, "waisStart: Failed because no relay host defined!\n");
squid_error_entry(entry, ERR_NO_RELAY, NULL);
waisState->method = method;
waisState->relayhost = Config.Wais.relayHost;
waisState->relayport = Config.Wais.relayPort;
- waisState->mime_hdr = mime_hdr;
+ waisState->request_hdr = entry->mem_obj->request_hdr;
waisState->fd = fd;
waisState->entry = entry;
xstrncpy(waisState->request, url, MAX_URL);