aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_setup.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/curl_setup.h')
-rw-r--r--lib/curl_setup.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index da26e48cb..d78873fe5 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -722,4 +722,19 @@ endings either CRLF or LF so 't' is appropriate.
#define FOPEN_WRITETEXT "w"
#endif
+/* WinSock destroys recv() buffer when send() failed.
+ * Enabled automatically for Windows and for Cygwin as Cygwin sockets are
+ * wrappers for WinSock sockets. https://github.com/curl/curl/issues/657
+ * Define DONT_USE_RECV_BEFORE_SEND_WORKAROUND to force disable workaround.
+ */
+#if !defined(DONT_USE_RECV_BEFORE_SEND_WORKAROUND)
+# if defined(WIN32) || defined(__CYGWIN__)
+# define USE_RECV_BEFORE_SEND_WORKAROUND
+# endif
+#else /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
+# ifdef USE_RECV_BEFORE_SEND_WORKAROUND
+# undef USE_RECV_BEFORE_SEND_WORKAROUND
+# endif
+#endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
+
#endif /* HEADER_CURL_SETUP_H */