ARMmbed / ATParser

Parser for AT commands and similar protocols.
36 stars 27 forks source link

Replace vector with map for oobs #4

Closed SherlockInSpace closed 2 years ago

SherlockInSpace commented 7 years ago

This patch replaces std::vector with std::map for the oobs struct when matching strings for callbacks. With std::vector it was possible that we could continually add callbacks with the same prefix and eventually run out of memory. By design it seems that the vrecv only invokes the callback for the first prefix match, so duplicate prefixes would never have their callbacks invoked.

Signed-off-by: Ryan Sherlock ryan.m.sherlock@gmail.com