summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-06-25 12:18:14 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-06-25 14:19:08 -0500
commitf3e0e466c7ad396cdf79bc9717a0e2c24050319e (patch)
treea8eb37d9c206f55639d24728c58bd489b8d988ed /src
parentbd8930579b47ff492f9ec788560bc46ccea0fa3d (diff)
downloadofono-f3e0e466c7ad396cdf79bc9717a0e2c24050319e.tar.bz2
gprs: Fix to attachment race condition
Sometimes we get unsolicited attachment status before our query finishes. If the client is fast enough they can attempt to attach and get the AttachInProgress error
Diffstat (limited to 'src')
-rw-r--r--src/gprs.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gprs.c b/src/gprs.c
index 11876e23..cf4f6267 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -896,8 +896,6 @@ static void registration_status_cb(const struct ofono_error *error,
if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
ofono_gprs_status_notify(gprs, status);
- gprs->flags &= ~GPRS_FLAG_ATTACHING;
-
if (gprs->flags & GPRS_FLAG_RECHECK) {
gprs->flags &= ~GPRS_FLAG_RECHECK;
gprs_netreg_update(gprs);
@@ -908,9 +906,9 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data)
{
struct ofono_gprs *gprs = data;
- if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
- gprs_attached_update(gprs);
- else
+ gprs->flags &= ~GPRS_FLAG_ATTACHING;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
gprs->driver_attached = !gprs->driver_attached;
if (gprs->driver->attached_status) {
@@ -919,7 +917,7 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data)
return;
}
- gprs->flags &= ~GPRS_FLAG_ATTACHING;
+ gprs_attached_update(gprs);
if (gprs->flags & GPRS_FLAG_RECHECK) {
gprs->flags &= ~GPRS_FLAG_RECHECK;