comparison sip-in/mncc_sock.c @ 105:9213ec8b434b

sip-in: handle themwi-mncc shutdown without terminating
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Sep 2022 23:00:52 -0800
parents e5aee661e3b2
children 245dc4837b56
comparison
equal deleted inserted replaced
104:ce3b1db7d1d7 105:9213ec8b434b
46 { 46 {
47 union mncc_msg msg; 47 union mncc_msg msg;
48 int rc; 48 int rc;
49 49
50 rc = recv(gsm_socket, &msg, sizeof msg, 0); 50 rc = recv(gsm_socket, &msg, sizeof msg, 0);
51 if (rc < 0) { 51 if (rc <= 0) {
52 syslog(LOG_CRIT, "error reading from mtcall socket: %m"); 52 syslog(LOG_ERR, "mtcall socket disconnected");
53 /* GSM disconnect handling to be implemented */ 53 shutdown_gsm_conn();
54 exit(1); 54 gsm_is_connected = 0;
55 } 55 }
56 if (rc < 4) { 56 if (rc < 4) {
57 syslog(LOG_CRIT, "short read from mtcall socket: %d bytes", rc); 57 syslog(LOG_CRIT, "short read from mtcall socket: %d bytes", rc);
58 exit(1); 58 exit(1);
59 } 59 }