Commit 3685f792 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

ignore SIGPIPE, as that can be actually get sent when we write to a socket

parent e227a276
Loading
Loading
Loading
Loading
+62 −57
Original line number Diff line number Diff line
@@ -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;