src/inc/net.h 1.36

1.36 2009/11/13 06:35:45 angie
Added netUrlOpenSockets/netGetOpenFtpSockets, which can pass the FTP control socket back to the caller instead of forking for the sake of closing the control socket immediately. This prevents the accumulation of zombie (defunct) child processes forked from the udcFuse daemon, and saves a bit of overhead. netUrl byterange can now be open-ended (only the start offset is specified), which also supports persistent connections in udcFuse. Also did some refactoring (readability & error messages).
Index: src/inc/net.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/net.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -b -B -U 4 -r1.35 -r1.36
--- src/inc/net.h	10 Nov 2009 23:23:58 -0000	1.35
+++ src/inc/net.h	13 Nov 2009 06:35:45 -0000	1.36
@@ -124,11 +124,17 @@
  * This is set up so that the http:// and the port are optional. 
  */
 
 int netUrlOpen(char *url);
-/* Return unix low-level file handle for url. 
+/* Return socket descriptor (low-level file handle) for read()ing url data. 
  * Just close(result) when done. */
 
+int netUrlOpenSockets(char *url, int *retCtrlSocket);
+/* Return socket descriptor (low-level file handle) for read()ing url data. 
+ * If retCtrlSocket is non-NULL and url is FTP, set *retCtrlSocket
+ * to the FTP control socket which is left open for a persistent connection.
+ * close(result) (and close(*retCtrlSocket) if applicable) when done. */
+
 struct hash;
 
 int netUrlHead(char *url, struct hash *hash);
 /* Go get head and return status.  Return negative number if