summaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-09-10 00:52:13 +0200
committerYang Tse <yangsita@gmail.com>2011-09-10 00:52:13 +0200
commita7d8894291a67463d33636519ce8e871ed13cf11 (patch)
treefd8df3b65b7dad7b6715bd74db0d3a98902b0f87 /lib/ssh.c
parent08a5a9b68d5be29a6c195109607e9c28ad6956ee (diff)
downloadcurl-a7d8894291a67463d33636519ce8e871ed13cf11.tar.gz
ssh.c: revert needless commit 7b7c45879e
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c60
1 files changed, 3 insertions, 57 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index d92ca212b..089b76110 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -111,7 +111,6 @@
/* Local functions: */
static const char *sftp_libssh2_strerror(unsigned long err);
static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc);
-static LIBSSH2_ALLOC_FUNC(my_libssh2_calloc);
static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc);
static LIBSSH2_FREE_FUNC(my_libssh2_free);
@@ -200,44 +199,6 @@ const struct Curl_handler Curl_handler_sftp = {
static void
-libssh2_version_components(int *major, int *minor, int *patch)
-{
- char buff[80];
- char *ptr = &buff[0];
- *major = 0;
- *minor = 0;
- *patch = 0;
-#ifdef HAVE_LIBSSH2_VERSION
- /* run-time version */
- snprintf(buff, sizeof(buff), "%s", libssh2_version(0));
-#else
- /* compile-time version */
- snprintf(buff, sizeof(buff), "%s", LIBSSH2_VERSION);
-#endif
- while(ptr && ISDIGIT(*ptr)) {
- *major *= 10;
- *major += *ptr - '0';
- ptr++;
- }
- if(*ptr == '.') {
- ptr++;
- while(ptr && ISDIGIT(*ptr)) {
- *minor *= 10;
- *minor += *ptr - '0';
- ptr++;
- }
- if(*ptr == '.') {
- ptr++;
- while(ptr && ISDIGIT(*ptr)) {
- *patch *= 10;
- *patch += *ptr - '0';
- ptr++;
- }
- }
- }
-}
-
-static void
kbd_callback(const char *name, int name_len, const char *instruction,
int instruction_len, int num_prompts,
const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
@@ -344,12 +305,6 @@ static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc)
return malloc(count);
}
-static LIBSSH2_ALLOC_FUNC(my_libssh2_calloc)
-{
- (void)abstract; /* arg not used */
- return calloc(1, count);
-}
-
static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc)
{
(void)abstract; /* arg not used */
@@ -2670,9 +2625,6 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
#endif
struct ssh_conn *ssh;
CURLcode result;
- int major = 0;
- int minor = 0;
- int patch = 0;
struct SessionHandle *data = conn->data;
/* We default to persistent connections. We set this already in this connect
@@ -2707,15 +2659,9 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
sock = conn->sock[FIRSTSOCKET];
#endif /* CURL_LIBSSH2_DEBUG */
- libssh2_version_components(&major, &minor, &patch);
- if((major < 1) || ((major == 1) && (minor < 3)))
- ssh->ssh_session = libssh2_session_init_ex(my_libssh2_calloc,
- my_libssh2_free,
- my_libssh2_realloc, conn);
- else
- ssh->ssh_session = libssh2_session_init_ex(my_libssh2_malloc,
- my_libssh2_free,
- my_libssh2_realloc, conn);
+ ssh->ssh_session = libssh2_session_init_ex(my_libssh2_malloc,
+ my_libssh2_free,
+ my_libssh2_realloc, conn);
if(ssh->ssh_session == NULL) {
failf(data, "Failure initialising ssh session");
return CURLE_FAILED_INIT;