{"action":"created","issue":{"url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/1341","labels_url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/1341/labels{/name}","comments_url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/1341/comments","events_url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/1341/events","html_url":"https://github.com/DarthGandalf/kvirc-issues/issues/1341","id":97281940,"number":1341,"title":"PATCH for not working DCC SSL sends","user":{"login":"DarthGandalf","id":325092,"avatar_url":"https://avatars.githubusercontent.com/u/325092?v=3","gravatar_id":"","url":"https://api.github.com/users/DarthGandalf","html_url":"https://github.com/DarthGandalf","followers_url":"https://api.github.com/users/DarthGandalf/followers","following_url":"https://api.github.com/users/DarthGandalf/following{/other_user}","gists_url":"https://api.github.com/users/DarthGandalf/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthGandalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthGandalf/subscriptions","organizations_url":"https://api.github.com/users/DarthGandalf/orgs","repos_url":"https://api.github.com/users/DarthGandalf/repos","events_url":"https://api.github.com/users/DarthGandalf/events{/privacy}","received_events_url":"https://api.github.com/users/DarthGandalf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-26T03:42:22Z","updated_at":"2015-07-26T03:42:25Z","closed_at":null,"body":"**Reported by htozehizzo on 24 Nov 2012 14:54:13 UTC**\nsecure sends will fail either right at the start or after a few kbs.\r\nThe issue highly depends on the OS, and is caused most likely by not proper or missing ssl_error handlin within the ssl_read accessing threads: \r\nhttps://svn.kvirc.de/kvirc/browser/trunk/kvirc/src/modules/dcc/DccFileTransfer.cpp sendack() / Run()\r\n\r\nsecure sends from a windows kvirc to a linux kvirc work (more or less at least), same for linux to linux. The biggest issues are when securely sending to a windows kvirc from windows and iirc also from linux kvirc to win kvirc, hence its the ssl_read implementation thats probably causing the issue.\r\n\r\nsidenote: Lowering the packetsize to 1/4K(i dont remember anymore which one of both, 1K or 4K) fixes it, but it will give very very very bad speeds (under windows and partially under linux) due ssl_write not waiting to fill up the 16K ssl_Write buffer but instead sending every packet right away which causes a great speed penalty, 16K should be the way to go.\r\n\r\nIf you want to reproduce this bug, just try to securely dcc send yourself a file.\r\n\r\nThis ticket is a dupe of ticket 1306, just in a way more detailed way.\r\n\n\n---\nMigrated from: https://svn.kvirc.de/kvirc/ticket/1341"},"comment":{"url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/comments/124938482","html_url":"https://github.com/DarthGandalf/kvirc-issues/issues/1341#issuecomment-124938482","issue_url":"https://api.github.com/repos/DarthGandalf/kvirc-issues/issues/1341","id":124938482,"user":{"login":"DarthGandalf","id":325092,"avatar_url":"https://avatars.githubusercontent.com/u/325092?v=3","gravatar_id":"","url":"https://api.github.com/users/DarthGandalf","html_url":"https://github.com/DarthGandalf","followers_url":"https://api.github.com/users/DarthGandalf/followers","following_url":"https://api.github.com/users/DarthGandalf/following{/other_user}","gists_url":"https://api.github.com/users/DarthGandalf/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthGandalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthGandalf/subscriptions","organizations_url":"https://api.github.com/users/DarthGandalf/orgs","repos_url":"https://api.github.com/users/DarthGandalf/repos","events_url":"https://api.github.com/users/DarthGandalf/events{/privacy}","received_events_url":"https://api.github.com/users/DarthGandalf/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T03:42:24Z","updated_at":"2015-07-26T03:42:24Z","body":"**Comment by htozehizzo on 18 Mar 2013 01:09:16**\nAs already stated earlier, ssl errors need to be properly handled, proposed fix:\r\n\r\nDccFileTransfer.cpp:\r\nline 471 ~:\r\nif (!m_pSSL && !handleInvalidSocketRead(readLen))\r\n break;\r\nssl transfers will be handled in the switch element before and bail out of the for loop\r\n\r\nplus in general add this to all ssl error switches:\r\n\t\t\t\t\t\t\tswitch(m_pSSL->getProtocolError(readLen))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcase KviSSL::ZeroReturn:\r\n\t\t\t\t\t\t\t\t\treadLen = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase KviSSL::Success:\r\n\t\t\t\t\t\t\t\tcase KviSSL::WantRead:\r\n\t\t\t\t\t\t\t\tcase KviSSL::WantWrite:\r\n\r\n\r\nyou simply forgot to add the case KviSSL::Succes: \r\n\r\nsends might still hickup, you'd have to fixup the sendack routine by the same principle as formerly mentioned - proper ssl error handling. Dont just close sockets on ret -1 when on ssl, since ret -1 doesnt equal = serious error. You can pretty much neglect them if they are ssl_want_write/want_read or success on nonblockin sockets as long you keep polling for socketdata in general.\r\nThis will fix up dcc ssl sends, I tested it and it worked fine (same high speeds as without ssl).\r\nWhile your at change:\r\n#define KVI_DCC_RECV_BLOCK_SIZE 8192\r\n#define KVI_DCC_RECV_75PERCENTOF_BLOCK_SIZE 6150\r\nto\r\n#define KVI_DCC_RECV_BLOCK_SIZE 16384\r\n#define KVI_DCC_RECV_75PERCENTOF_BLOCK_SIZE 12280\r\n\r\n\r\nBest regards\r\nsanchez!\r\n\n\n---\nSummary: secure dcc send not working properly, due inproper ssl_error handling withing the ssl_read()  accessing function [OS dependent issue] → PATCH for not working DCC SSL sends\nVersion: 4.2.0 Equilibrium → 4.3.1 Aria"}}