src/inc/net.h 1.37
1.37 2010/03/10 23:41:17 angie
Instead of errAborting in low-level net.c routines, pass errors up to higher-level code, most of which already checks for error return values.
Index: src/inc/net.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/net.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -b -B -U 4 -r1.36 -r1.37
--- src/inc/net.h 13 Nov 2009 06:35:45 -0000 1.36
+++ src/inc/net.h 10 Mar 2010 23:41:17 -0000 1.37
@@ -6,18 +6,13 @@
#ifndef NET_H
#define NET_H
-#ifndef LINEFILE_H
#include "linefile.h"
-#endif /* LINEFILE_H */
-
-#ifndef DYSTRING_H
#include "dystring.h"
-#endif /* DYSTRING_H */
int netConnect(char *hostName, int port);
-/* Start connection with a server having resolved port. */
+/* Start connection with a server having resolved port. Return < 0 if error. */
int netMustConnect(char *hostName, int port);
/* Start connection with server or die. */
@@ -124,13 +119,14 @@
* This is set up so that the http:// and the port are optional.
*/
int netUrlOpen(char *url);
-/* Return socket descriptor (low-level file handle) for read()ing url data.
- * Just close(result) when done. */
+/* Return socket descriptor (low-level file handle) for read()ing url data,
+ * or -1 if error. Just close(result) when done. */
int netUrlOpenSockets(char *url, int *retCtrlSocket);
-/* Return socket descriptor (low-level file handle) for read()ing url data.
+/* Return socket descriptor (low-level file handle) for read()ing url data,
+ * or -1 if error.
* 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. */
@@ -174,9 +170,10 @@
* specified in the url send user name and password
* too. Typically the "method" will be "GET" or "POST"
* and the agent will be the name of your program or
* library. optionalHeader may be NULL or contain
- * additional header lines such as cookie info. */
+ * additional header lines such as cookie info.
+ * Return data socket, or -1 if error.*/
int netHttpGetMultiple(char *url, struct slName *queries, void *userData,
void (*responseCB)(void *userData, char *req,
char *hdr, struct dyString *body));