/*
- * $Id: ftp.cc,v 1.106 1997/05/15 01:18:44 wessels Exp $
+ * $Id: ftp.cc,v 1.107 1997/05/15 23:37:58 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
static PF ftpTimeout;
static char *ftpGetBasicAuth _PARAMS((const char *));
static void ftpProcessReplyHeader _PARAMS((FtpStateData *, const char *, int));
-static void ftpStartComplete _PARAMS((void *, int));
static void ftpLoginParser _PARAMS((const char *, FtpStateData *));
/* External functions */
buf = get_free_8k_page();
path = ftpState->request->urlpath;
- mode = "-"; /* let ftpget figure it out */
+ mode = "-"; /* let ftpget figure it out */
/* Start building the buffer ... */
strcat(buf, Config.Program.ftpget);
return 0; /* different username */
}
-
-int
+void
ftpStart(request_t * request, StoreEntry * entry)
-{
- ftp_ctrl_t *ctrlp;
- debug(9, 3, "FtpStart: '%s'\n", entry->url);
- if (ftpget_server_write < 0) {
- squid_error_entry(entry, ERR_FTP_DISABLED, NULL);
- return COMM_ERROR;
- }
- ctrlp = xmalloc(sizeof(ftp_ctrl_t));
- ctrlp->request = request;
- ctrlp->entry = entry;
- storeLockObject(entry, ftpStartComplete, ctrlp);
- return COMM_OK;
-}
-
-static void
-ftpStartComplete(void *data, int status)
{
LOCAL_ARRAY(char, realm, 8192);
- ftp_ctrl_t *ctrlp = data;
- request_t *request = ctrlp->request;
- StoreEntry *entry = ctrlp->entry;
char *url = entry->url;
FtpStateData *ftpState = xcalloc(1, sizeof(FtpStateData));
char *req_hdr;
char *response;
+ debug(9, 3, "FtpStart: '%s'\n", entry->url);
+ if (ftpget_server_write < 0) {
+ squid_error_entry(entry, ERR_FTP_DISABLED, NULL);
+ return;
+ }
+ storeLockObject(entry);
ftpState->entry = entry;
- xfree(ctrlp);
req_hdr = entry->mem_obj->mime_hdr;
ftpState->request = requestLink(request);
if (!ftpCheckAuth(ftpState, req_hdr)) {
/*
- * $Id: gopher.cc,v 1.79 1997/05/15 01:06:55 wessels Exp $
+ * $Id: gopher.cc,v 1.80 1997/05/15 23:38:00 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
int size,
int errflag,
void *data);
-static void gopherStartComplete _PARAMS((void *datap, int status));
static PF gopherSendRequest;
static GopherStateData *CreateGopherStateData _PARAMS((void));
static CNCB gopherConnectDone;
storeSetPublicKey(gopherState->entry); /* Make it public */
}
-int
+void
gopherStart(StoreEntry * entry)
{
- storeLockObject(entry, gopherStartComplete, entry);
- return COMM_OK;
-}
-
-
-static void
-gopherStartComplete(void *datap, int status)
-{
- StoreEntry *entry = datap;
char *url = entry->url;
GopherStateData *gopherState = CreateGopherStateData();
int fd;
+ storeLockObject(entry);
gopherState->entry = entry;
debug(10, 3, "gopherStart: url: %s\n", url);
/* Parse url. */
/*
- * $Id: http.cc,v 1.160 1997/05/08 07:22:02 wessels Exp $
+ * $Id: http.cc,v 1.161 1997/05/15 23:38:01 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
httpState->orig_request = NULL;
}
-int
+void
proxyhttpStart(request_t * orig_request,
StoreEntry * entry,
peer * e)
if (fd == COMM_ERROR) {
debug(11, 4, "proxyhttpStart: Failed because we're out of sockets.\n");
squid_error_entry(entry, ERR_NO_FDS, xstrerror());
- return COMM_ERROR;
+ return;
}
- storeLockObject(entry, NULL, NULL);
+ storeLockObject(entry);
httpState = xcalloc(1, sizeof(HttpStateData));
httpState->entry = entry;
httpState->req_hdr = entry->mem_obj->mime_hdr;
httpState->fd,
httpConnect,
httpState);
- return COMM_OK;
}
static void
}
}
-int
+void
httpStart(request_t * request,
char *req_hdr,
int req_hdr_sz,
if (fd == COMM_ERROR) {
debug(11, 4, "httpStart: Failed because we're out of sockets.\n");
squid_error_entry(entry, ERR_NO_FDS, xstrerror());
- return COMM_ERROR;
+ return;
}
- storeLockObject(entry, NULL, NULL);
+ storeLockObject(entry);
httpState = xcalloc(1, sizeof(HttpStateData));
httpState->entry = entry;
httpState->req_hdr = req_hdr;
httpState->fd,
httpConnect,
httpState);
- return COMM_OK;
}
void
/*
- * $Id: ssl.cc,v 1.50 1997/05/15 06:55:49 wessels Exp $
+ * $Id: ssl.cc,v 1.51 1997/05/15 23:38:02 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
sslConnected(sslState->server.fd, sslState);
}
-int
+void
sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size_ptr)
{
/* Create state structure. */
NULL,
NULL,
xfree);
- return COMM_ERROR;
+ return;
}
sslState = xcalloc(1, sizeof(SslStateData));
sslState->url = xstrdup(url);
sslPeerSelectComplete,
sslPeerSelectFail,
sslState);
- return COMM_OK;
}
static void
/*
- * $Id: tunnel.cc,v 1.50 1997/05/15 06:55:49 wessels Exp $
+ * $Id: tunnel.cc,v 1.51 1997/05/15 23:38:02 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
sslConnected(sslState->server.fd, sslState);
}
-int
+void
sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size_ptr)
{
/* Create state structure. */
NULL,
NULL,
xfree);
- return COMM_ERROR;
+ return;
}
sslState = xcalloc(1, sizeof(SslStateData));
sslState->url = xstrdup(url);
sslPeerSelectComplete,
sslPeerSelectFail,
sslState);
- return COMM_OK;
}
static void
/*
- * $Id: wais.cc,v 1.69 1997/05/02 21:34:19 wessels Exp $
+ * $Id: wais.cc,v 1.70 1997/05/15 23:38:02 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
storeSetPublicKey(waisState->entry); /* Make it public */
}
-int
+void
waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
{
WaisStateData *waisState = NULL;
if (!Config.Wais.relayHost) {
debug(24, 0, "waisStart: Failed because no relay host defined!\n");
squid_error_entry(entry, ERR_NO_RELAY, NULL);
- return COMM_ERROR;
+ return;
}
fd = comm_open(SOCK_STREAM,
0,
if (fd == COMM_ERROR) {
debug(24, 4, "waisStart: Failed because we're out of sockets.\n");
squid_error_entry(entry, ERR_NO_FDS, xstrerror());
- return COMM_ERROR;
+ return;
}
waisState = xcalloc(1, sizeof(WaisStateData));
waisState->method = method;
waisStateFree,
waisState);
commSetTimeout(fd, Config.Timeout.read, waisTimeout, waisState);
- storeLockObject(entry, NULL, NULL);
+ storeLockObject(entry);
waisState->ip_lookup_pending = 1;
ipcache_nbgethostbyname(waisState->relayhost,
waisState->fd,
waisConnect,
waisState);
- return COMM_OK;
}
static void