8ea9060d3944ce427e6485c356edc26d7dafb8d3
jcasper
  Wed Sep 25 15:57:16 2024 -0700
fakeCurl needn't open the same file repeatedly for requests to the same URL, refs #34493

diff --git src/hg/inc/fakeCurl.h src/hg/inc/fakeCurl.h
index da3bd39..7719f15 100644
--- src/hg/inc/fakeCurl.h
+++ src/hg/inc/fakeCurl.h
@@ -32,26 +32,28 @@
 } CURLoption;
 
 typedef enum {
     CURLE_OK,
     CURLE_NOTOK
 } CURLcode;
 
 typedef struct {
     char *url;
     char *range;
     void *writeBuffer;
     size_t (*WriteFunction) (char *buffer, size_t size, size_t nitems, void *outstream);
     size_t (*HeaderFunction) (char *buffer, size_t size, size_t nitems, void *outstream);
     int failonerror;
     // currently ignoring follow location setting and user agent string - we always follow, no string
+    struct udcFile *udc; // As long as we're querying the same URL, keep the udcFile open and just seek
+    long udcSize; // to simplify repeated checks against udcFileSize
 } CURL;
 
 typedef size_t (*curl_write_callback)(char *buffer, size_t size, size_t nitems, void *outstream);
 
 CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
 CURLcode curl_easy_perform(CURL *curl);
 const char *curl_easy_strerror(CURLcode errornum);
 CURL *curl_easy_init(void);
 void curl_easy_cleanup(CURL *curl);
 
 #endif