Commit Graph

104 Commits

Author SHA1 Message Date
Max Kellermann a0bee9fa0a db/upnp/Discovery: eliminate two strlen() calls 2014-01-22 21:47:34 +01:00
Max Kellermann 0defd927f3 db/upnp: use std::list instead of std::set for SearchCapabilities
Reduce bloat.  We never used the set lookup.
2014-01-22 21:41:05 +01:00
Max Kellermann 6c41e8f63f db/upnp: check offset<total at end of loop 2014-01-22 21:37:21 +01:00
Max Kellermann fa67a4e956 db/upnp: break when zero objects have been returned 2014-01-22 21:37:19 +01:00
Max Kellermann bf9352fb26 db/upnp: free responses manually 2014-01-22 21:33:54 +01:00
Max Kellermann 7573d4e1ba db/upnp: break when count==0
Make this non-fatal.  Just stop reading more objects.
2014-01-22 21:33:19 +01:00
Max Kellermann bfb483898f db/upnp: use ParseUnsigned() instead of atoi() 2014-01-22 21:11:04 +01:00
Max Kellermann f363788d76 db/upnp: pass unsigned integers to readDirSlice() 2014-01-22 20:57:10 +01:00
Max Kellermann 714056f157 db/upnp: inline ContentDirectoryService::readDirSlice() 2014-01-22 20:42:36 +01:00
Max Kellermann 1abc96fa27 db/upnp: remove special case for "*"
Passing this to csvToStrings() will do the same.
2014-01-22 20:37:17 +01:00
Max Kellermann 0fa98479ad db/upnp: obtain char* from ixmlwrap::getFirstElementValue()
Fixes crash when there's no SearchCaps element.
2014-01-22 20:26:33 +01:00
Max Kellermann 02f2171010 db/upnp/Util: pass char* to csvToStrings() 2014-01-22 20:24:55 +01:00
Max Kellermann a5e7d0a90f db/upnp: require an empty input capability set 2014-01-22 20:21:01 +01:00
Max Kellermann 9fb5134f64 db/upnp/Util: handle absolute URI paths properly in caturl()
Fixes problems with some UPnP servers.
2014-01-22 19:38:07 +01:00
Max Kellermann 9aeb23dfe9 db/upnp/Util: use string::back(), string::front() 2014-01-22 19:38:02 +01:00
Max Kellermann e59d8c9378 db/upnp/Device: clear the "value" pointer on unknown element
Avoid appending to an obsolete string object.
2014-01-22 19:38:02 +01:00
Max Kellermann 9747cc9e58 db/upnp/Device: replace std::vector with a std::string pointer 2014-01-22 09:55:51 +01:00
Max Kellermann 7b44dea4b1 db/upnp/Device: remove unused UPnPService attributes 2014-01-22 09:51:26 +01:00
Max Kellermann 18aea922e9 db/upnp/Directory: "emplace" items into the vector 2014-01-22 09:43:49 +01:00
Max Kellermann 7d194aceb6 db/upnp/Device: emplace/move the UPnPService into the vector
Reduce overhead.
2014-01-22 09:42:46 +01:00
Max Kellermann 2722b8a3df db/upnp/Util: "emplace" items into the list
Reduce overhead.
2014-01-22 09:40:38 +01:00
Max Kellermann fd754ff8f8 db/upnp/Directory: replace std::vector with a simple enum
Reduce bloat.
2014-01-22 09:32:11 +01:00
Max Kellermann b7738e7af3 db/upnp/Directory: join all CDATA nodes for tag values
Expat can call CharacterData() multiple times if the CDATA contains
entity references.  We need to collect all of them in one large
string.
2014-01-22 08:44:35 +01:00
Max Kellermann 99bebabac9 db/upnp/Directory: make "m_dir" private 2014-01-22 08:44:20 +01:00
Max Kellermann 5434856136 db/upnp: use std::list instead of std::vector
Reduce overhead.
2014-01-21 23:33:28 +01:00
Max Kellermann 411527a240 db/upnp: don't use stringToTokens() in ParseDuration()
Reduce bloat.
2014-01-21 22:52:12 +01:00
Max Kellermann fab6cbed75 db/upnp/Discovery: eliminate attribute "last_seen" 2014-01-18 16:28:12 +01:00
Max Kellermann 051eede1ed db/upnp/Discovery: use monotonic clock instead of time() 2014-01-18 16:26:11 +01:00
Max Kellermann 0696cac50b db/upnp/Discovery: eliminate full copy in getServer() 2014-01-18 16:18:51 +01:00
Max Kellermann 7d696a7063 db/upnp/Discovery: eliminate Error attribute
Move code to method Start() and add Error& parameters to several
methods.
2014-01-18 16:08:30 +01:00
Max Kellermann 5409e43fb5 db/upnp: cache m_path.back() 2014-01-18 15:44:41 +01:00
Max Kellermann f33f891c54 db/upnp: add UpnpMakeAction() helper function 2014-01-18 15:27:54 +01:00
Max Kellermann 6e55552292 db/upnp/ixmlwrap: getFirstElementValue() returns const char *
Eliminate the std::string bloat.
2014-01-18 15:01:19 +01:00
Max Kellermann e569f82dd3 db/upnp: merge duplicate nullptr check 2014-01-18 14:44:06 +01:00
Max Kellermann 1a4940bbda db/upnp: free IXML_Document *request manually 2014-01-18 14:38:52 +01:00
Max Kellermann 22dd3c8048 db/upnp/Device: move code to method Parse()
Forward the Error to the caller.
2014-01-18 14:29:31 +01:00
Max Kellermann 04b7648e00 db/upnp/Device: use ContentDirectoryDescriptor's move operator
Reduce bloat.
2014-01-18 14:26:24 +01:00
Max Kellermann be0759d465 db/upnp/Discovery: don't copy XML to std::string
Pass "const char *" to Expat.
2014-01-18 14:24:38 +01:00
Max Kellermann 339d939873 db/upnp/Discovery: fix memory leak 2014-01-18 14:03:18 +01:00
Max Kellermann c1950e40e6 db/upnp: remove unused typedef DevServIt 2014-01-18 13:42:54 +01:00
Max Kellermann ad76bad8fd db/upnp: use move operator to assign XML CDATA
Reduce runtime bloat.
2014-01-18 13:39:31 +01:00
Max Kellermann 55737e4ff6 db/upnp/Util: trimstring() constructs string from buffer
Reduce overhead by omitting the part of the buffer that consists only
of whitespace.
2014-01-18 13:36:50 +01:00
Max Kellermann f3b4ddee6c db/upnp/Discovery: free the response body
Memory leak.
2014-01-18 13:08:48 +01:00
Max Kellermann 758b504cf3 db/upnp/Discovery: don't copy the response body
Bloat.
2014-01-18 13:07:42 +01:00
Max Kellermann 416f7c2600 db/upnp: don't hold mutex while downloading device description
Must not perform blocking I/O while holding a mutex.
2014-01-18 13:04:01 +01:00
Max Kellermann b9f02f22c4 db/upnp: don't use WorkQueue for _ADVERTISEMENT_BYEBYE
Remove the ContentDirectoryDescriptor right away.  Reduces bloat.
2014-01-18 12:56:35 +01:00
Max Kellermann e2812f722d db/upnp/Discovery: move callbacks and data structures into class
Eliminate global variables.
2014-01-17 10:13:04 +01:00
Max Kellermann aa64a5328e db/upnp: split cluCallback() 2014-01-17 09:46:51 +01:00
Max Kellermann 59510f509a db/upnp: add local reference variables
Prepare to refactor some code.
2014-01-17 00:17:20 +01:00
Max Kellermann a35c7bc81a db/upnp: move the LibUPnP instance to class UpnpDatabase
Delete the object when closing the database.
2014-01-16 09:30:24 +01:00