serial-port: don't steal data from PPP when connected

There was a race where if PPP was slow to start, MM could read the
first bits of PPP from the port, which MM shouldn't really do.  So
if the port is connected, don't read any data and let pppd do its
thing.

See the logs in https://bugzilla.gnome.org/show_bug.cgi?id=624956#c10
for an example of this:

DEBUG: <1280300196.929489> (ttyACM0): <-- '<CR><LF>CONNECT<CR><LF>'
DEBUG: <1280300196.929761> (ttyACM0): port now connected
DEBUG: <1280300196.929853> Modem /org/freedesktop/ModemManager/Modems/0: state changed (connecting -> connected)
DEBUG: <1280300196.929954> (ttyACM0): simple connect state 6
DEBUG: <1280300196.933432> (ttyACM0): <-- '~\-1}#\-64!}!} } }2}#}$\-64#}!}$}%\-36}"}&} }*} } g}%~'
This commit is contained in:
Dan Williams
2013-02-12 15:26:21 -06:00
parent 67fcac2541
commit 625e1c4884
+4
View File
@@ -767,6 +767,10 @@ data_available (GIOChannel *source,
if (info && (info->started == TRUE) && (info->done == FALSE))
return TRUE;
/* Don't steal data from PPP if we're connected */
if (mm_port_get_connected (MM_PORT (self)))
return TRUE;
do {
GError *err = NULL;