Commit d5188393 authored by Slava Monich's avatar Slava Monich

[mms-lib] mms_dispatcher_receive_message should write PDU to file if running with -t

This way it will end up in the tarball generated by MMS Logger app,
and it's generally useful for debugging.
parent 6a8d50d8
......@@ -543,10 +543,18 @@ mms_dispatcher_receive_message(
if (pdu) {
MMS_ASSERT(pdu->type == MMS_MESSAGE_TYPE_NOTIFICATION_IND);
if (pdu->type == MMS_MESSAGE_TYPE_NOTIFICATION_IND) {
const MMSConfig* config = disp->settings->config;
ok = mms_dispatcher_queue_and_unref_task(disp,
mms_task_retrieve_new(disp->settings, disp->handler,
id, imsi, pdu, automatic ? MMS_CONNECTION_TYPE_AUTO :
MMS_CONNECTION_TYPE_USER, error));
if (config->keep_temp_files) {
char* dir = mms_message_dir(config, id);
mms_write_bytes(dir, MMS_NOTIFICATION_IND_FILE, bytes, NULL);
g_free(dir);
}
} else {
MMS_ERROR(error, MMS_LIB_ERROR_DECODE, "Inexpected MMS PDU type");
}
mms_message_free(pdu);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment