| 567 |
567 |
| 568 static void no_one_calls(gpointer data, gint source, GaimInputCondition cond) |
568 static void no_one_calls(gpointer data, gint source, GaimInputCondition cond) |
| 569 { |
569 { |
| 570 struct PHB *phb = data; |
570 struct PHB *phb = data; |
| 571 unsigned int len; |
571 unsigned int len; |
| 572 int error = ETIMEDOUT; |
572 int error=0; |
| |
573 int ret=0; |
| 573 |
574 |
| 574 debug_printf("Connected\n"); |
575 debug_printf("Connected\n"); |
| 575 |
576 |
| 576 len = sizeof(error); |
577 len = sizeof(error); |
| 577 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { |
578 |
| |
579 ret = getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len); |
| |
580 if (ret < 0 || error != 0) { |
| 578 close(source); |
581 close(source); |
| 579 gaim_input_remove(phb->inpa); |
582 gaim_input_remove(phb->inpa); |
| 580 phb->func(phb->data, -1, GAIM_INPUT_READ); |
583 phb->func(phb->data, -1, GAIM_INPUT_READ); |
| 581 g_free(phb->host); |
584 g_free(phb->host); |
| 582 g_free(phb); |
585 g_free(phb); |
| |
586 debug_printf("getsockopt SO_ERROR check: %s\n", |
| |
587 strerror(((ret<0) ? errno : error))); |
| 583 return; |
588 return; |
| 584 } |
589 } |
| 585 fcntl(source, F_SETFL, 0); |
590 fcntl(source, F_SETFL, 0); |
| 586 gaim_input_remove(phb->inpa); |
591 gaim_input_remove(phb->inpa); |
| 587 phb->func(phb->data, source, GAIM_INPUT_READ); |
592 phb->func(phb->data, source, GAIM_INPUT_READ); |