Guest User

Untitled

a guest
Jun 23rd, 2018
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. From a85015dfee93ff75467cd34f06e27f5fb9c56fe7 Mon Sep 17 00:00:00 2001
  2. From: Devid Antonio Filoni <devidfil@gmail.com>
  3. Date: Sun, 12 Jul 2009 11:53:33 +0200
  4. Subject: [PATCH] pn_oim.c: improve process_body_send
  5.  
  6. ---
  7. pn_oim.c | 13 ++++++++-----
  8. 1 files changed, 8 insertions(+), 5 deletions(-)
  9.  
  10. diff --git a/pn_oim.c b/pn_oim.c
  11. index c72c885..e9d3fcb 100644
  12. --- a/pn_oim.c
  13. +++ b/pn_oim.c
  14. @@ -505,12 +505,13 @@ process_body_send (OimRequest *oim_request,
  15. cur = strstr (body, "<LockKeyChallenge ");
  16. if (cur)
  17. {
  18. - gsize lockkey_len;
  19. - gchar *lockkey;
  20. + gchar *lockkey, *end;
  21.  
  22. - lockkey_len = strlen (cur) - 67 - strlen (strstr ((const char*) body, "</LockKeyChallenge>"));
  23. - lockkey = malloc (lockkey_len);
  24. - strncpy (lockkey, cur + 67, lockkey_len);
  25. + cur = strchr (cur, '>') + 1;
  26. + end = strchr (cur, '<');
  27. + lockkey = g_strndup (cur, end - cur);
  28. +
  29. + pn_error ("lockkey=[%s]", lockkey);
  30.  
  31. pn_handle_challenge (lockkey, "PROD01065C%ZFN6F", "O4BG@C7BWLYQX?5G", oim_request->oim_session->lockkey);
  32.  
  33. @@ -530,6 +531,8 @@ process_body_send (OimRequest *oim_request,
  34. error = _("The following message wasn't sent because the system is unavailable. This normally happens when the user is blocked or does not exist.");
  35. else if (strstr (body, "q0:SenderThrottleLimitExceeded"))
  36. error = _("The following message wasn't sent because you've sent messages too quickly.");
  37. + else if (strstr (body, "q0:MessageTooLarge"))
  38. + error = _("The following message wasn't sent because it's too large.");
  39. else
  40. return;
  41.  
  42. --
  43. 1.6.3.3
Add Comment
Please, Sign In to add comment