aboutsummaryrefslogtreecommitdiff
path: root/lib/urldata.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-09-10 22:15:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-09-10 22:15:32 +0000
commit8240cea628cfcfdd962d1dfa4ae40e27ed2e9bfb (patch)
treec1783e52135113b643ae5699c59f998d568e2918 /lib/urldata.h
parentf2a33eb372ec958dbb0c5eeeab546eedbaa617c2 (diff)
Jeff Pohlmeyer presented a *multi_socket()-using program that exposed a
problem with it (SIGSEGV-style). It clearly showed that the existing socket-state and state-difference function wasn't good enough so I rewrote it and could then re-run Jeff's program without any crash. The previous version clearly could miss to tell the application when a handle changed from using one socket to using another. While I was at it (as I could use this as a means to track this problem down), I've now added a 'magic' number to the easy handle struct that is inited at curl_easy_init() time and cleared at curl_easy_cleanup() time that we can use internally to detect that an easy handle seems to be fine, or at least not closed or freed (freeing in debug builds fill the area with 0x13 bytes but in normal builds we can of course not assume any particular data in the freed areas).
Diffstat (limited to 'lib/urldata.h')
-rw-r--r--lib/urldata.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index bce51e971..1479cd7e3 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -117,6 +117,8 @@
of need. */
#define HEADERSIZE 256
+#define CURLEASY_MAGIC_NUMBER 0xc0dedbad
+
/* Just a convenience macro to get the larger value out of two given.
We prefix with CURL to prevent name collisions. */
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
@@ -1292,6 +1294,7 @@ struct SessionHandle {
iconv_t inbound_cd; /* for translating from the network encoding */
iconv_t utf8_cd; /* for translating to UTF8 */
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
+ unsigned int magic; /* set to a CURLEASY_MAGIC_NUMBER */
};
#define LIBCURL_NAME "libcurl"