Skip to content

Commit

Permalink
[mms-lib] When cancelling all tasks, close connection as well
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Feb 24, 2015
1 parent cf18645 commit 38d5666
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mms-lib/src/mms_dispatcher.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -570,9 +571,16 @@ mms_dispatcher_cancel(
mms_task_cancel(task);
}
}

if (mms_task_match_id(disp->active_task, id)) {
mms_task_cancel(disp->active_task);
}

/* If we have cancelling all tasks, close the network connection
* immediately to finish up as soon as possible. */
if (!id && disp->connection) {
mms_dispatcher_close_connection(disp);
}
}

/**
Expand Down

0 comments on commit 38d5666

Please sign in to comment.