Limit the number of contexts that we manage

This commit is contained in:
Denis Kenzior 2009-11-02 11:31:29 -06:00
parent 708f7481b0
commit 3c702b4d99
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#define GPRS_FLAG_ATTACHING 0x1
#define MAX_CONTEXT_NAME_LENGTH 127
#define MAX_CONTEXTS 256
static GSList *g_drivers = NULL;
static GSList *g_context_drivers = NULL;
@ -752,6 +753,9 @@ static DBusMessage *gprs_create_context(DBusConnection *conn,
if (type == GPRS_CONTEXT_TYPE_INVALID)
return __ofono_error_invalid_format(msg);
if (g_slist_length(gprs->contexts) >= MAX_CONTEXTS)
return __ofono_error_not_supported(msg);
context = pri_context_create(gprs);
if (!context) {