Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L libotr
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 50
    • Issues 50
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Libraries
  • libotr
  • Issues
  • #26

Closed
Open
Created Apr 01, 2016 by MartinMilata@b42

Empty message injected when otrl_message_sending to recipient in finished state

Related to #17.

The OTRL_FRAGMENT_SEND_ALL behavior is somewhat confusing when the recipient is in OTRL_MSGSTATE_FINISHED. In this case, otrl_message_sending:

  • calls handle_msg_event callback with OTRL_MSGEVENT_CONNECTION_ENDED,
  • calls inject_message callback with empty string (""),
  • sets messagep to the empty string, and
  • returns successfully.

Setting messagep to non-NULL and returning zero is consistent with the case when libotr sends the message successfully (and thus the caller shouldn't). The user is also notified that the message was actually not sent through the handle_msg_event callback. I would suggest not to call the inject_message callback, though, as it serves no purpose.

Proposed patch:

--- a/src/message.c
+++ b/src/message.c
@@ -439,7 +439,7 @@ fragment:
 	return err;
     } else {
 	/* Fragment and send according to policy */
-	if (!err && messagep && *messagep) {
+	if (!err && messagep && *messagep && *messagep[0]) {
 	    if (context) {
 		err = fragment_and_send(ops, opdata, context, *messagep,
 			fragPolicy, messagep);

Other possibility is to check the messagep for non-zero length inside fragment_and_send.

(from redmine: created on 2014-04-22)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking