Re: [Devel] Two (or 3) issues with oversized messages via MM1
Patched. Thanks On Jan 04, 2011, at 18:25, Piotr Isajew wrote: > There was a bug in a patch I sent on 23rd Dec. It could cause > segfaults in mmsbox. I'm attaching a corrected version against > current CVS source. > > ___ > Devel mailing list > [email protected] > http://lists.mbuni.org/mailman/listinfo/devel ___ Devel mailing list [email protected] http://lists.mbuni.org/mailman/listinfo/devel
Re: [Devel] Two (or 3) issues with oversized messages via MM1
There was a bug in a patch I sent on 23rd Dec. It could cause
segfaults in mmsbox. I'm attaching a corrected version against
current CVS source.
--- mbuni-cvs-orig/extras/mmsbox-mm1/mmsbox_mm1.c
+++ mbuni-cvs/extras/mmsbox-mm1/mmsbox_mm1.c
@@ -344,11 +344,15 @@
mms_info(0, "mmsbox-mm1", NULL, "sent message, type=%s, result=%s",
mms_message_type_to_cstr(mms_messagetype(m)), r->error ?
octstr_get_cstr(r->error) : "(none)");
/* destroy the structure. */
+ if(r->error && (octstr_compare(r->error,
octstr_imm("Error-service-denied")) == 0 ||
+octstr_compare(r->error,
octstr_imm("Error-permanent-failure")) == 0))
+ *retry = 0;
+ else
+ *retry = 1;
pthread_cond_destroy(&r->cond);
pthread_mutex_destroy(&r->mutex);
gw_free(r);
- *retry = 1; /* always retry ?? */
return id;
}
@@ -491,9 +495,17 @@
mms_warning(0, "mmsbox-mm1", NULL,"No send-conf
returned by operator");
if (m == NULL ||
- (r->result = mms_get_header_value(m,
octstr_imm("Message-ID"))) == NULL) {
+ (r->result = mms_get_header_value(m,
octstr_imm("Message-ID"))) == NULL ||
+ octstr_compare(mms_get_header_value(m,
octstr_imm("X-Mms-Response-Status")),
+ octstr_imm("Ok")) != 0
+ ) {
Octstr *err = m ? mms_get_header_value(m,
octstr_imm("X-Mms-Response-Text")) : NULL;
Octstr *status = m ? mms_get_header_value(m,
octstr_imm("X-Mms-Response-Status")) : NULL;
+if(status && (octstr_compare(status,
octstr_imm("Error-service-denied")) == 0 ||
+ octstr_compare(status,
octstr_imm("Error-permanent-failure")) == 0)) {
+ r->error = octstr_duplicate(status);
+}
+r->result = NULL; /* indicate failure to bearerbox */
mms_error(0, "mmsbox-mm1", NULL, "Sending failed: %s,
%s!",
err ? octstr_get_cstr(err) : "(none)",
status ? octstr_get_cstr(status) : "(none)");
pgpdIvMXsDHzp.pgp
Description: PGP signature
___
Devel mailing list
[email protected]
http://lists.mbuni.org/mailman/listinfo/devel
Re: [Devel] Two (or 3) issues with oversized messages via MM1
Loks good. Applied. Thanks
On Jan 02, 2011, at 21:49, Piotr Isajew wrote:
> On Thu, Dec 23, 2010 at 04:47:08PM +0100, Piotr Isajew wrote:
>
>> I'm attaching a patch that fixes those problems for me. However
>> after applying it I noticed that DLR url isn't called for failed
>> messages:
>
> I think I found the solution:
>
> --- mbuni-cvs-orig/mmsbox/bearerbox.c
> +++ mbuni-cvs/mmsbox/bearerbox.c
> @@ -1563,8 +1563,14 @@
> if (rr_url)
> mms_dlr_url_put(id, "read-report", groupid, rr_url,
> orig_transid);
> ret = MMS_SEND_OK;
> - } else
> - ret = retry ? MMS_SEND_ERROR_TRANSIENT : MMS_SEND_ERROR_FATAL;
> + } else {
> + ret = retry ? MMS_SEND_ERROR_TRANSIENT : MMS_SEND_ERROR_FATAL;
> + if(!retry) {
> + if(dlr_url)
> + mms_dlr_url_put(e->msgId, "delivery-report", groupid, dlr_url,
> orig_transid);
> + }
> + }
>
> *new_msgid = id;
> ___
> Devel mailing list
> [email protected]
> http://lists.mbuni.org/mailman/listinfo/devel
___
Devel mailing list
[email protected]
http://lists.mbuni.org/mailman/listinfo/devel
Re: [Devel] Two (or 3) issues with oversized messages via MM1
On Thu, Dec 23, 2010 at 04:47:08PM +0100, Piotr Isajew wrote:
> I'm attaching a patch that fixes those problems for me. However
> after applying it I noticed that DLR url isn't called for failed
> messages:
I think I found the solution:
--- mbuni-cvs-orig/mmsbox/bearerbox.c
+++ mbuni-cvs/mmsbox/bearerbox.c
@@ -1563,8 +1563,14 @@
if (rr_url)
mms_dlr_url_put(id, "read-report", groupid, rr_url,
orig_transid);
ret = MMS_SEND_OK;
- } else
- ret = retry ? MMS_SEND_ERROR_TRANSIENT : MMS_SEND_ERROR_FATAL;
+ } else {
+ ret = retry ? MMS_SEND_ERROR_TRANSIENT : MMS_SEND_ERROR_FATAL;
+ if(!retry) {
+ if(dlr_url)
+ mms_dlr_url_put(e->msgId, "delivery-report", groupid, dlr_url,
orig_transid);
+ }
+ }
*new_msgid = id;
pgptaeu1cUCFx.pgp
Description: PGP signature
___
Devel mailing list
[email protected]
http://lists.mbuni.org/mailman/listinfo/devel
