comparison libsip/primary_parse.c @ 44:30572642e853

libsip/primary_parse.c: SIP-Version is case-insensitive per RFC 3261
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 05 Sep 2022 10:37:36 -0800
parents 77d980126efd
children f1cf80c7e243
comparison
equal deleted inserted replaced
43:5995660dcbac 44:30572642e853
40 40
41 static 41 static
42 try_status_line(msg) 42 try_status_line(msg)
43 struct sip_pkt_rx *msg; 43 struct sip_pkt_rx *msg;
44 { 44 {
45 if (strncmp(msg->pkt_buffer, "SIP/2.0 ", 8)) 45 if (strncasecmp(msg->pkt_buffer, "SIP/2.0 ", 8))
46 return(0); 46 return(0);
47 if (!isdigit(msg->pkt_buffer[8])) 47 if (!isdigit(msg->pkt_buffer[8]))
48 return(0); 48 return(0);
49 if (!isdigit(msg->pkt_buffer[9])) 49 if (!isdigit(msg->pkt_buffer[9]))
50 return(0); 50 return(0);
76 while (*cp && !isspace(*cp)) 76 while (*cp && !isspace(*cp))
77 cp++; 77 cp++;
78 if (*cp != ' ') 78 if (*cp != ' ')
79 return(0); 79 return(0);
80 *cp++ = '\0'; 80 *cp++ = '\0';
81 if (strcmp(cp, "SIP/2.0")) 81 if (strcasecmp(cp, "SIP/2.0"))
82 return(0); 82 return(0);
83 else 83 else
84 return(1); 84 return(1);
85 } 85 }
86 86