Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add session/channel byte/packet counters | Audrius Butkevicius | 2014-02-12 | 1 | -0/+6 |
| | | | | Signed-off-by: Audrius Butkevicius <audrius.butkevicius@elastichosts.com> | ||||
* | socket: fix read of non-connected socket | Jon Simons | 2014-02-02 | 1 | -1/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure to check whether the socket at hand is indeed still connected throughout POLLIN processing in ssh_socket_pollcallback. Before this change, the POLLIN block in ssh_socket_pollcallback is predicated against the condition (s->state == SSH_SOCKET_CONNECTED). Once entered, data from the socket is consumed through the data callback in this loop: do { r = s->callbacks->data(buffer_get_rest(s->in_buffer), buffer_get_rest_len(s->in_buffer), s->callbacks->userdata); buffer_pass_bytes(s->in_buffer,r); } while (r > 0); However, it is possible for the socket data callback to change the state of the socket (closing it, for example). Fix the loop to only continue so long as the socket remains connected: this also entails setting the ssh_socket state to SSH_SOCKET_CLOSED upon close. The bug can be observed before the change by sending a bogus banner to the server: 'echo -e "A\r\nB\r\n" | nc localhost 22'. Each of 'A' and 'B' will be processed by 'callback_receive_banner', even though the client socket is closed after rejection of 'A'. Reviewed-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | src: Define MAX_BUF_SIZE globally and use it. | Joseph Southwell | 2014-02-02 | 1 | -1/+1 |
| | | | | Reviewed-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | src: Rename buffer_add_data() to ssh_buffer_add_data(). | Andreas Schneider | 2014-01-19 | 1 | -2/+2 |
| | |||||
* | src: Rename buffer_init to ssh_buffer_init(). | Andreas Schneider | 2014-01-19 | 1 | -2/+2 |
| | |||||
* | src: Do not use deprecated functions. | Andreas Schneider | 2014-01-16 | 1 | -2/+2 |
| | |||||
* | socket: don't attempt reading a non-connected socket | Aris Adamantiadis | 2014-01-05 | 1 | -1/+1 |
| | |||||
* | sockets: null pointer check | Aris Adamantiadis | 2013-11-18 | 1 | -5/+7 |
| | |||||
* | socket: Fix connect if we pass in a fd. | Andreas Schneider | 2013-11-15 | 1 | -9/+13 |
| | | | | | | BUG: https://red.libssh.org/issues/106 Thanks to Saju Panikulam. | ||||
* | Add ssh_get_poll_flags() | Colin Walters | 2013-11-09 | 1 | -0/+11 |
| | | | | | | | | | | For integration with an external mainloop, we need to know how to replicate libssh's internal poll() calls. We originally through ssh_get_status() was that API, but it's not really - those flags only get updated from the *result* of a poll(), where what we really need is to know how libssh would *start* a poll(). Reviewed-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | socket: Fix check for pending data. | Aris Adamantiadis | 2013-11-03 | 1 | -3/+3 |
| | | | | | | BUG: https://red.libssh.org/issues/119 Reviewed-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | src: Remove enter_function() and leave_function(). | Andreas Schneider | 2013-07-14 | 1 | -16/+8 |
| | |||||
* | src: Migrate to SSH_LOG. | Andreas Schneider | 2013-07-14 | 1 | -5/+5 |
| | |||||
* | socket: Check if socket (non)blocking is working. | Andreas Schneider | 2013-06-17 | 1 | -9/+12 |
| | |||||
* | socket: Check return value of getsockopt(). | Andreas Schneider | 2013-06-17 | 1 | -1/+4 |
| | |||||
* | socket: Call data handler as long as handler takes data. | Johannes Krude | 2013-01-29 | 1 | -4/+6 |
| | | | | Reviewed-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | socket: Check return value of buffer function. | Andreas Schneider | 2012-10-09 | 1 | -1/+4 |
| | | | | Found by Coverity. | ||||
* | socket: Add a SSH_WRITE_PENDING socket status. | Andreas Schneider | 2012-07-17 | 1 | -0/+4 |
| | |||||
* | socket: Move socket function to right location. | Andreas Schneider | 2011-09-18 | 1 | -1/+22 |
| | |||||
* | channels: Fix checking for fatal errors. | rofl0r | 2011-08-06 | 1 | -18/+20 |
| | | | | We need this that we don't end up in and infinite poll loop. | ||||
* | Fix "connecting to closed port" on MacosX | Aris Adamantiadis | 2011-05-20 | 1 | -1/+1 |
| | |||||
* | socket: Fixed use-after-free. | Oliver Stöneberg | 2011-05-17 | 1 | -0/+6 |
| | | | | | When s->callbacks->exception() was called in ssh_socket_pollcallback() we had a use after free bug. | ||||
* | [socket] fix a segfault at disconnect | milo | 2011-05-02 | 1 | -4/+15 |
| | | | | (cherry picked from commit 56394917b15e41603c641c22a4e29c33b096d673) | ||||
* | init: Some initialization fixes. | Oliver Stöneberg | 2011-05-01 | 1 | -6/+18 |
| | | | | | | | | - Check result of ssh_init() in privatekey_from_base64() - Moved code from ssh_finalize() to appropriate subroutines - Only initialize sockets once (caused mismatch of WSAStartup() and WSACleanup() calls and potential usage of bsd_poll when win_poll should be used) | ||||
* | socket: Fixed poll input event. | Oliver Stöneberg | 2011-05-01 | 1 | -1/+1 |
| | |||||
* | poll: Fix poll input events. | Andreas Schneider | 2011-04-15 | 1 | -1/+1 |
| | | | | bug#38 | ||||
* | build: Fixed some VS2010 problems. | Oliver Stöneberg | 2011-04-11 | 1 | -1/+1 |
| | |||||
* | Implement ssh_blocking_flush() | Aris Adamantiadis | 2011-03-22 | 1 | -0/+12 |
| | | | | Based on code from Jan Willamowius | ||||
* | socket: Set errors on return. | Bernhard R. Link | 2011-02-14 | 1 | -1/+16 |
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> | ||||
* | Fix use-after-free when socket is closed in a callback handler | Aris Adamantiadis | 2011-01-19 | 1 | -2/+15 |
| | |||||
* | Fix double-connect testcase | Aris Adamantiadis | 2011-01-15 | 1 | -0/+19 |
| | |||||
* | Removed the extern char *environ | Aris Adamantiadis | 2010-09-30 | 1 | -3/+0 |
| | |||||
* | Remove extern environ from the requirements | Aris Adamantiadis | 2010-09-29 | 1 | -1/+1 |
| | |||||
* | Fixed outgoing flow control + writes behaviours | Aris Adamantiadis | 2010-09-26 | 1 | -24/+28 |
| | |||||
* | socket.c: Fixed setting max_fd which breaks ssh_select(). | Vic Lee | 2010-09-20 | 1 | -2/+6 |
| | | | | Signed-off-by: Andreas Schneider <asn@cynapses.org> | ||||
* | socket: Make code easier to read and debug. | Andreas Schneider | 2010-09-07 | 1 | -8/+10 |
| | |||||
* | misc: Rename libssh/ to src/ | Andreas Schneider | 2010-09-06 | 1 | -0/+719 |