Re: ModemManager: ensure response array is empty before setting cached response



On Tue, 2011-04-12 at 20:07 +0200, Aleksander Morgado wrote:
> Hi all,
> 
> ModemManager will cache responses of commands when requested to do so,
> so that the next time the same command is issued the cached response can
> be used instead of resending it to the modem (useful for example when a
> single port is used and the modem is connected). This is done by
> appending the cached response to the internal response array. Now, if
> for any reason the response array has some not-consumed data, appending
> the cached response into the response array may end up in really
> undesired situations [1].
> 
> The attached patch prevents this situation, by making sure that when
> using a cached response, the response array is always empty. It's
> probably quite safe to assume that whenever we want to use a cached
> reply, there shouldn't be any previous data in the response array. 

Pushed, thanks!
Dan

> Comments?
> 
> Cheers,
> 
> [1] I've got a case where there is some non-UTF-8 data added to the
> response array just after the CONNECT reply. If we then we GetImei() via
> d-bus, the cached reply of +CGSN is appended to the array, and once we
> try to send the whole response back through d-bus, dbus-daemon
> disconnects us because we sent non-UTF-8 data (the one which got added
> to the array before our cached reply), and the ModemManager process
> nicely exit()s (or abort()s, depending on who packages d-bus).
> 
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]