return CURLE_OK;
}
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
/*
* Internal read-from-socket function. This is meant to deal with plain
* sockets, SSL sockets and kerberos sockets.
/* If session can pipeline, check connection buffer */
if(pipelining) {
- size_t bytestocopy = MIN(conn->buf_len - conn->read_pos, sizerequested);
+ size_t bytestocopy = CURLMIN(conn->buf_len - conn->read_pos, sizerequested);
/* Copy from our master buffer first if we have some unread data there*/
if(bytestocopy > 0) {
}
/* If we come here, it means that there is no data to read from the buffer,
* so we read from the socket */
- bytesfromsocket = MIN(sizerequested, BUFSIZE * sizeof (char));
+ bytesfromsocket = CURLMIN(sizerequested, BUFSIZE * sizeof (char));
buffertofill = conn->master_buffer;
}
else {
- bytesfromsocket = MIN((long)sizerequested, conn->data->set.buffer_size ?
+ bytesfromsocket = CURLMIN((long)sizerequested, conn->data->set.buffer_size ?
conn->data->set.buffer_size : BUFSIZE);
buffertofill = buf;
}
Curl_ssl_data_pending(conn, FIRSTSOCKET);
}
-#ifndef MIN
-#define MIN(a,b) (a < b ? a : b)
-#endif
-
static void read_rewind(struct connectdata *conn,
size_t thismuch)
{
char buf[512 + 1];
size_t show;
- show = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
+ show = CURLMIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
if(conn->master_buffer) {
memcpy(buf, conn->master_buffer + conn->read_pos, show);
buf[show] = '\0';
#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
-/* Just a convenience macro to get the larger value out of two given.
+/* Some convenience macros to get the larger/smaller value out of two given.
We prefix with CURL to prevent name collisions. */
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
+#define CURLMIN(x,y) ((x)<(y)?(x):(y))
+
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
/* Types needed for krb4/5-ftp connections */
#define CURL_PROGRESS_STATS 0 /* default progress display */
#define CURL_PROGRESS_BAR 1
-/**
- * @def MIN
- * standard MIN macro
- */
-#ifndef MIN
-#define MIN(X,Y) (((X) < (Y)) ? (X) : (Y))
-#endif
-
typedef enum {
HTTPREQ_UNSPEC,
HTTPREQ_GET,