jonib wrote:I'll add more code to handle missing information. I would prefer to see any error messages as those give better understanding what went wrong. But thanks for the debugging anyway.
Yeah, I understand the need for debugging output, my main problem with that was that I couldn't actually get anything sensible out of it. I tried printing everything coming into the Headers() function to try to figure out which message caused the crashing, but couldn't get any.
The crashing seemed kind of random, but usually it happened around the time when I was expecting an OnScanFinished (or similar) event from xbmc. Here's my understanding of what happens:
1. xbmc2 goes into a loop, looking for xbmc to show up on the SSDP "channel"
2. I start xbmc, the plugin detects it and sets itself up for receiving notifications
3. i trigger a video library scan from eventghost, this works fine. I get a onscanstartet notification back into eventghost
4. eventghost goes into listening mode with xbmc2 running in the background. misc services (e.g dvbviewer) send messages in ssdp, these are received and discarded by xbmc2
5. suddenly, the data = recv(4096) picks up "something" (i tried to print it, nothing showed up in the log), and the Headers() function tries to parse this into something sensible. however, it was just an "empty" message, so there's no 'start-line' key in the resulting headers dict, and the if test blows up. (The error message from xbmc2 was about this specifically, KeyError in headers)
Because I couldn't figure out what was picked up in that recv() that triggered the Headers parsing method, I just circumvented it my making sure the if test on the start-line value doesn't crash, and the code exits back to the waiting state in the next if test anyway.
I -think- this error showed up around Gotham beta 1, I've been running monthly's for a while, with no problems. I rarely change anything on this computer except upgrading xbmc.
I'll see about getting the error message out from an untouched xbmc2 plugin, but if you could possibly make a new testing version with more debugging output around the receiving and parsing of ssdp messages, that could be useful (I'm pretty clueless about Python, really).
Tusse.