mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
ignore SIGPIPE, as that can be actually get sent when we write to a socket
This commit is contained in:
parent
e227a276ce
commit
3685f792cb
17
lib/url.c
17
lib/url.c
@ -206,7 +206,10 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
|
||||
/* Very simple start-up: alloc the struct, init it with zeroes and return */
|
||||
data = (struct SessionHandle *)malloc(sizeof(struct SessionHandle));
|
||||
if(data) {
|
||||
if(!data)
|
||||
/* this is a very serious error */
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
memset(data, 0, sizeof(struct SessionHandle));
|
||||
|
||||
/* We do some initial setup here, all those fields that can't be just 0 */
|
||||
@ -261,7 +264,7 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
*curl = data;
|
||||
|
||||
/*************************************************************
|
||||
* Set signal handler
|
||||
* Set signal handler to catch SIGALRM
|
||||
*************************************************************/
|
||||
#ifdef HAVE_SIGACTION
|
||||
sigaction(SIGALRM, NULL, &sigact);
|
||||
@ -275,17 +278,19 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
/* no sigaction(), revert to the much lamer signal() */
|
||||
#ifdef HAVE_SIGNAL
|
||||
signal(SIGALRM, alarmfunc);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*************************************************************
|
||||
* Tell signal handler to ignore SIGPIPE
|
||||
*************************************************************/
|
||||
#if defined(HAVE_SIGNAL) && defined(SIGPIPE)
|
||||
(void) signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* this is a very serious error */
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
|
||||
{
|
||||
va_list param;
|
||||
|
Loading…
Reference in New Issue
Block a user