comparison freeDiameter/cnxctx.c @ 228:dcb58243e91f

More cleanups
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 02 Mar 2010 14:58:19 +0900
parents 80a7e65167c4
children 965f5971dc23
comparison
equal deleted inserted replaced
227:80a7e65167c4 228:dcb58243e91f
541 void fd_cnx_markerror(struct cnxctx * conn) 541 void fd_cnx_markerror(struct cnxctx * conn)
542 { 542 {
543 TRACE_ENTRY("%p", conn); 543 TRACE_ENTRY("%p", conn);
544 CHECK_PARAMS_DO( conn, goto fatal ); 544 CHECK_PARAMS_DO( conn, goto fatal );
545 545
546 TRACE_DEBUG(FULL, "CC_STATUS_ERROR set for socket %d (%s)", conn->cc_socket, conn->cc_id); 546 TRACE_DEBUG(FULL, "Error flag set for socket %d (%s / %s)", conn->cc_socket, conn->cc_remid, conn->cc_id);
547 547
548 /* Mark the error */ 548 /* Mark the error */
549 conn->cc_status |= CC_STATUS_ERROR; 549 conn->cc_status |= CC_STATUS_ERROR;
550 550
551 /* Report the error if not reported yet, and not closing */ 551 /* Report the error if not reported yet, and not closing */
728 do { 728 do {
729 CHECK_FCT_DO( fd_sctp_recvmeta(conn->cc_socket, NULL, &buf, &bufsz, &event, &conn->cc_status), goto fatal ); 729 CHECK_FCT_DO( fd_sctp_recvmeta(conn->cc_socket, NULL, &buf, &bufsz, &event, &conn->cc_status), goto fatal );
730 if (event == FDEVP_CNX_ERROR) { 730 if (event == FDEVP_CNX_ERROR) {
731 fd_cnx_markerror(conn); 731 fd_cnx_markerror(conn);
732 goto out; 732 goto out;
733 }
734
735 if (event == FDEVP_CNX_SHUTDOWN) {
736 /* Just ignore the notification for now, we will get another error later anyway */
737 continue;
733 } 738 }
734 739
735 CHECK_FCT_DO( fd_event_send( Target_Queue(conn), event, bufsz, buf), goto fatal ); 740 CHECK_FCT_DO( fd_event_send( Target_Queue(conn), event, bufsz, buf), goto fatal );
736 741
737 } while (conn->cc_loop); 742 } while (conn->cc_loop);
803 808
804 case GNUTLS_E_AGAIN: 809 case GNUTLS_E_AGAIN:
805 case GNUTLS_E_INTERRUPTED: 810 case GNUTLS_E_INTERRUPTED:
806 if (!(conn->cc_status & CC_STATUS_CLOSING)) 811 if (!(conn->cc_status & CC_STATUS_CLOSING))
807 goto again; 812 goto again;
808 TRACE_DEBUG(INFO, "Connection is closing, so abord gnutls_record_recv now."); 813 TRACE_DEBUG(FULL, "Connection is closing, so abord gnutls_record_recv now.");
809 break; 814 break;
810 815
816 case GNUTLS_E_UNEXPECTED_PACKET_LENGTH:
817 /* The connection is closed */
818 TRACE_DEBUG(FULL, "Got 0 size while reading the socket, probably connection closed...");
819 break;
820
811 default: 821 default:
812 TRACE_DEBUG(INFO, "This TLS error is not handled, assume unrecoverable error"); 822 TRACE_DEBUG(INFO, "This GNU TLS error is not handled, assume unrecoverable error");
813 } 823 }
814 } ); 824 } );
815 end: 825 end:
816 if (ret <= 0) 826 if (ret <= 0)
817 fd_cnx_markerror(conn); 827 fd_cnx_markerror(conn);
"Welcome to our mercurial repository"