int line, const char *source);
#endif
-/* send/receive sockets */
-CURL_EXTERN SEND_TYPE_RETV curl_dbg_send(SEND_TYPE_ARG1 sockfd,
- SEND_QUAL_ARG2 SEND_TYPE_ARG2 buf,
- SEND_TYPE_ARG3 len,
- SEND_TYPE_ARG4 flags, int line,
- const char *source);
-CURL_EXTERN RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd,
- RECV_TYPE_ARG2 buf,
- RECV_TYPE_ARG3 len,
- RECV_TYPE_ARG4 flags, int line,
- const char *source);
-
/* FILE functions */
CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source);
CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fopen(const char *file, const char *mode,
#define CURL_ACCEPT4(sock, addr, len, flags) \
curl_dbg_accept4(sock, addr, len, flags, __LINE__, __FILE__)
#endif
-#define CURL_SEND(a, b, c, d) curl_dbg_send(a, b, c, d, __LINE__, __FILE__)
-#define CURL_RECV(a, b, c, d) curl_dbg_recv(a, b, c, d, __LINE__, __FILE__)
#else /* !CURLDEBUG */
#ifdef HAVE_ACCEPT4
#define CURL_ACCEPT4 accept4
#endif
-#define CURL_SEND send
-#define CURL_RECV recv
#endif /* CURLDEBUG */
return sockfd;
}
-SEND_TYPE_RETV curl_dbg_send(SEND_TYPE_ARG1 sockfd,
- SEND_QUAL_ARG2 SEND_TYPE_ARG2 buf,
- SEND_TYPE_ARG3 len, SEND_TYPE_ARG4 flags,
- int line, const char *source)
-{
- SEND_TYPE_RETV rc;
- if(countcheck("send", line, source))
- return -1;
- /* !checksrc! disable BANNEDFUNC 1 */
- rc = send(sockfd, buf, len, flags);
- if(source)
- curl_dbg_log("SEND %s:%d send(%lu) = %ld\n",
- source, line, (unsigned long)len, (long)rc);
- return rc;
-}
-
-RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd, RECV_TYPE_ARG2 buf,
- RECV_TYPE_ARG3 len, RECV_TYPE_ARG4 flags,
- int line, const char *source)
-{
- RECV_TYPE_RETV rc;
- if(countcheck("recv", line, source))
- return -1;
- /* !checksrc! disable BANNEDFUNC 1 */
- rc = recv(sockfd, buf, len, flags);
- if(source)
- curl_dbg_log("RECV %s:%d recv(%lu) = %ld\n",
- source, line, (unsigned long)len, (long)rc);
- return rc;
-}
-
#ifdef HAVE_SOCKETPAIR
int curl_dbg_socketpair(int domain, int type, int protocol,
curl_socket_t socket_vector[2],
int t;
int l = (int)sizeof(t);
if(!getsockopt(s, SOL_SOCKET, SO_TYPE, (char *)&t, &l) && t == SOCK_STREAM)
- CURL_SEND(s, NULL, 0, 0);
+ send(s, NULL, 0, 0);
}
#endif
*psent = 0;
- while((rv = CURL_SEND(qctx->sockfd, (const char *)pkt,
- (SEND_TYPE_ARG3)pktlen, 0)) == -1 &&
+ while((rv = send(qctx->sockfd, (const char *)pkt,
+ (SEND_TYPE_ARG3)pktlen, 0)) == -1 &&
SOCKERRNO == SOCKEINTR)
;
"open" => 1,
"printf" => 1,
"realloc" => 1,
- "recv" => 1,
"rename" => 1,
- "send" => 1,
"snprintf" => 1,
"socket" => 1,
"socketpair" => 1,
execute */
if(per->uploadfile && !strcmp(per->uploadfile, ".") && per->infd > 0) {
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
- rc = CURL_RECV(per->infd, buffer, curlx_uztosi(sz * nmemb), 0);
+ rc = recv(per->infd, buffer, curlx_uztosi(sz * nmemb), 0);
if(rc < 0) {
if(SOCKERRNO == SOCKEWOULDBLOCK) {
errno = 0;
break;
if(n == 0)
break;
- nwritten = CURL_SEND(socket_w, buffer, n, 0);
+ nwritten = send(socket_w, buffer, n, 0);
if(nwritten == SOCKET_ERROR)
break;
if((DWORD)nwritten != n)
my $reallocs = 0;
my $strdups = 0;
my $wcsdups = 0;
- my $sends = 0;
- my $recvs = 0;
my $sockets = 0;
$memsum = 0; # the total number of memory allocated over the lifetime
elsif($_ =~ /^GETNAME ([^ ]*):(\d*) (.*)/) {
# not much to do
}
- # SEND url.c:1901 send(83) = 83
- elsif($_ =~ /^SEND ([^ ]*):(\d*) (.*)/) {
- $sends++;
- }
- # RECV url.c:1901 recv(102400) = 256
- elsif($_ =~ /^RECV ([^ ]*):(\d*) (.*)/) {
- $recvs++;
- }
# ADDR url.c:1282 getaddrinfo() = 0x5ddd
elsif($_ =~ /^ADDR ([^ ]*):(\d*) (.*)/) {
"Strdups: $strdups\n",
"Wcsdups: $wcsdups\n",
"Frees: $frees\n",
- "Sends: $sends\n",
- "Recvs: $recvs\n",
"Sockets: $sockets\n",
"Allocations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups)."\n",
- "Operations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups + $sends + $recvs + $sockets)."\n",
+ "Operations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups + $sockets)."\n",
"Maximum allocated: $maxmem\n",
"Total allocated: $memsum\n";
}