bebcb6453c54164564b24899c6f407310b551a93
max
  Thu Jan 5 06:37:34 2023 -0800
first go at s3:// support, refs #30445

adding cache file to UDC protocol support, refs #30445

handling expired presigned URLs in udc protocol, refs #30445

diff --git src/hg/lib/cart.c src/hg/lib/cart.c
index e770bc7..ff556ab 100644
--- src/hg/lib/cart.c
+++ src/hg/lib/cart.c
@@ -1,29 +1,30 @@
 /* Copyright (C) 2014 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #include "common.h"
 #include "hCommon.h"
 #include "obscure.h"
 #include "linefile.h"
 #include "errAbort.h"
 #include "hash.h"
 #include "cheapcgi.h"
 #include "cartDb.h"
 #include "htmshell.h"
 #include "hgConfig.h"
 #include "cart.h"
+#include "verbose.h"
 #include "net.h"
 #include "web.h"
 #include "hdb.h"
 #include "jksql.h"
 #include "jsHelper.h"
 #include "trashDir.h"
 #ifndef GBROWSE
 #include "customFactory.h"
 #include "googleAnalytics.h"
 #include "wikiLink.h"
 #endif /* GBROWSE */
 #include "hgMaf.h"
 #include "hui.h"
 #include "geoMirror.h"
 #include "hubConnect.h"
@@ -1385,31 +1386,31 @@
         struct dyString *dyMessage = dyStringNew(0);
 	boolean ok = cartLoadSettingsFromUserInput(lf, cart, oldVars, hgsDoLoadUrl, dyMessage);
 	lineFileClose(&lf);
 	cartTrace(cart, "after cartLS", conn);
         if (! ok)
             {
             warn("Unable to load session file: %s", dyMessage->string);
             }
 	didSessionLoad = ok;
         dyStringFree(&dyMessage);
 	}
     }
 #endif /* GBROWSE */
 
 /* wire up the assembly hubs so we can operate without sql */
-setUdcTimeout(cart);
+setUdcOptions(cart);
 if (cartVarExists(cart, hgHubDoDisconnect))
     doDisconnectHub(cart);
 
 if (didSessionLoad)
     cartCopyCustomComposites(cart);
 
 char *newDatabase = hubConnectLoadHubs(cart);
 
 if (newDatabase != NULL)
     {
     char *cartDb = cartOptionalString(cart, "db");
 
     if ((cartDb == NULL) || differentString(cartDb, newDatabase))
         {
         // this is some magic to use the defaultPosition and reset cart variables
@@ -2320,30 +2321,34 @@
 char *noSqlInj_level = cfgOption("noSqlInj.level");
 if (noSqlInj_level)
     setenv("noSqlInj_level", noSqlInj_level, TRUE);
 char *noSqlInj_dumpStack = cfgOption("noSqlInj.dumpStack");
 if (noSqlInj_dumpStack)
     setenv("noSqlInj_dumpStack", noSqlInj_dumpStack, TRUE);
 
 
 // if ignoreCookie is on the URL, don't check for cookies
 char *hguid = NULL;
 if ( cgiOptionalString("ignoreCookie") == NULL )
     hguid = getCookieId(cookieName);
 char *hgsid = getSessionId();
 struct cart *cart = cartNew(hguid, hgsid, exclude, oldVars);
 cartExclude(cart, sessionVar);
+
+// activate optional debuging output for CGIs
+verboseCgi(cartCgiUsualString(cart, "verbose", NULL));
+
 return cart;
 }
 
 static void addHttpHeaders()
 /* CGIs can initialize the global variable httpHeaders to control their own HTTP
  * headers. This allows, for example, to prevent web browser caching of hgTracks
  * responses, but implicitly allow web browser caching everywhere else */
 {
 struct slPair *h;
 for (h = httpHeaders; h != NULL; h = h->next)
     {
     printf("%s: %s\n", h->name, (char *)h->val);
     }
 }