Found when using MediaConnect (iPhone app from app store) and my DLNA UPNP plugin.
MediaConnect POST's with the following USER-AGENT HTTP header
USER-AGENT: iPhoneOS/5.0.1, UPnP/1.0, MediaConnect/2.0
According to HTTP 1.1 RFC - User-Agent section. (HTTP/1.1: Header Field Definitions)
The comma isn't used when separating product tokens, but is used for separating other field tokens, which is where possible spec confusion has occurred.
The failure occurs in UPnP/Infrastructure/Common/UPnPVersion.cs in method TryParse()
Once the string has been split up we end up processing the token as follows...
versionStr = "UPnP/1.0,"
This causes a problem with the following if...
if (!int.TryParse(versionStr.Substring(dotIndex + 1), out verMin))
return false;
Int.TryParse gets given "0," and throws an exception. My temp fix for this is as follows...
if (!int.TryParse(versionStr.Substring(dotIndex + 1).TrimEnd(','), out verMin))
return false;
It's crude, but works for now. A better fix is probably needed.
MediaConnect POST's with the following USER-AGENT HTTP header
USER-AGENT: iPhoneOS/5.0.1, UPnP/1.0, MediaConnect/2.0
According to HTTP 1.1 RFC - User-Agent section. (HTTP/1.1: Header Field Definitions)
The comma isn't used when separating product tokens, but is used for separating other field tokens, which is where possible spec confusion has occurred.
The failure occurs in UPnP/Infrastructure/Common/UPnPVersion.cs in method TryParse()
Once the string has been split up we end up processing the token as follows...
versionStr = "UPnP/1.0,"
This causes a problem with the following if...
if (!int.TryParse(versionStr.Substring(dotIndex + 1), out verMin))
return false;
Int.TryParse gets given "0," and throws an exception. My temp fix for this is as follows...
if (!int.TryParse(versionStr.Substring(dotIndex + 1).TrimEnd(','), out verMin))
return false;
It's crude, but works for now. A better fix is probably needed.