]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make the fooStart() functions all void
authorwessels <>
Fri, 16 May 1997 05:37:58 +0000 (05:37 +0000)
committerwessels <>
Fri, 16 May 1997 05:37:58 +0000 (05:37 +0000)
Since storeLockObject no longer does swapping in, we don't need to split
fooStart() into two functions separated by the swappin callback.

src/ftp.cc
src/gopher.cc
src/http.cc
src/ssl.cc
src/tunnel.cc
src/wais.cc

index 64ba159ec936149ce16332574686e2cea5a9e5b5..733b34845eb2ccbf4d4200651329ac73af411fd4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -141,7 +141,6 @@ static PF ftpStateFree;
 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 */
@@ -429,7 +428,7 @@ ftpSendRequest(int fd, void *data)
     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);
@@ -538,36 +537,21 @@ ftpCheckAuth(FtpStateData * ftpState, char *req_hdr)
     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)) {
index a41644360dba5a7f0784124e1e2580fd81c1bd6d..5c88e69989b7527ec9c688a1243e49cbcc86fc4f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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
@@ -175,7 +175,6 @@ static void gopherSendComplete(int fd,
     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;
@@ -859,21 +858,13 @@ gopherSendRequest(int fd, void *data)
        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. */
index 07290e4b594967351b0a14983920c1ec70415819..b6d22ce34bafe9fe611b1bdbfbe01d99f3be9b81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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
@@ -834,7 +834,7 @@ httpSendRequest(int fd, void *data)
     httpState->orig_request = NULL;
 }
 
-int
+void
 proxyhttpStart(request_t * orig_request,
     StoreEntry * entry,
     peer * e)
@@ -858,9 +858,9 @@ proxyhttpStart(request_t * orig_request,
     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;
@@ -885,7 +885,6 @@ proxyhttpStart(request_t * orig_request,
        httpState->fd,
        httpConnect,
        httpState);
-    return COMM_OK;
 }
 
 static void
@@ -931,7 +930,7 @@ httpConnectDone(int fd, int status, void *data)
     }
 }
 
-int
+void
 httpStart(request_t * request,
     char *req_hdr,
     int req_hdr_sz,
@@ -952,9 +951,9 @@ httpStart(request_t * request,
     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;
@@ -970,7 +969,6 @@ httpStart(request_t * request,
        httpState->fd,
        httpConnect,
        httpState);
-    return COMM_OK;
 }
 
 void
index d8d001e10a9ba0086163d5234a6a9197aac13e06..a59013a638d5ab67b7c4726d001664afb694197f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -381,7 +381,7 @@ sslConnectDone(int fd, int status, void *data)
        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. */
@@ -411,7 +411,7 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
            NULL,
            NULL,
            xfree);
-       return COMM_ERROR;
+       return;
     }
     sslState = xcalloc(1, sizeof(SslStateData));
     sslState->url = xstrdup(url);
@@ -438,7 +438,6 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslPeerSelectComplete,
        sslPeerSelectFail,
        sslState);
-    return COMM_OK;
 }
 
 static void
index 8ee39c45ff7ed278901759467f4858085aabf630..8cc9276bce7d33b88072590455da55f804093e95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -381,7 +381,7 @@ sslConnectDone(int fd, int status, void *data)
        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. */
@@ -411,7 +411,7 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
            NULL,
            NULL,
            xfree);
-       return COMM_ERROR;
+       return;
     }
     sslState = xcalloc(1, sizeof(SslStateData));
     sslState->url = xstrdup(url);
@@ -438,7 +438,6 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslPeerSelectComplete,
        sslPeerSelectFail,
        sslState);
-    return COMM_OK;
 }
 
 static void
index e5b425d3c2028c396fe15b89458681f52ed5adaa..ab018d63d44bddef67b68a48689193846fdf048f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -298,7 +298,7 @@ waisSendRequest(int fd, void *data)
        storeSetPublicKey(waisState->entry);    /* Make it public */
 }
 
-int
+void
 waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
 {
     WaisStateData *waisState = NULL;
@@ -309,7 +309,7 @@ waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
     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,
@@ -320,7 +320,7 @@ waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
     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;
@@ -334,13 +334,12 @@ waisStart(method_t method, char *mime_hdr, StoreEntry * entry)
        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