make libssh2_scp_send/recv do blocking mode correctly
Somehow I had completely missed to make the libssh2_scp_send/recv functions support the blocking mode the correct way so when I cleaned up things the other day blocking mode broke for them... Fixed now.
Этот коммит содержится в:
родитель
3fda91d725
Коммит
9e84b999a5
45
src/scp.c
45
src/scp.c
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
|
/* Copyright (c) 2009 by Daniel Stenberg
|
||||||
|
* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
@ -260,13 +261,13 @@ libssh2_shell_quotearg(const char *path, unsigned char *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libssh2_scp_recv
|
* scp_recv
|
||||||
*
|
*
|
||||||
* Open a channel and request a remote file via SCP
|
* Open a channel and request a remote file via SCP
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
LIBSSH2_API LIBSSH2_CHANNEL *
|
static LIBSSH2_CHANNEL *
|
||||||
libssh2_scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb)
|
scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb)
|
||||||
{
|
{
|
||||||
int cmd_len;
|
int cmd_len;
|
||||||
int rc;
|
int rc;
|
||||||
@ -763,14 +764,28 @@ libssh2_scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libssh2_scp_send_ex
|
* libssh2_scp_recv
|
||||||
|
*
|
||||||
|
* Open a channel and request a remote file via SCP
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
LIBSSH2_API LIBSSH2_CHANNEL *
|
||||||
|
libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, struct stat * sb)
|
||||||
|
{
|
||||||
|
LIBSSH2_CHANNEL *ptr;
|
||||||
|
BLOCK_ADJUST_ERRNO(ptr, session, scp_recv(session, path, sb));
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* scp_send()
|
||||||
*
|
*
|
||||||
* Send a file using SCP
|
* Send a file using SCP
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
LIBSSH2_API LIBSSH2_CHANNEL *
|
static LIBSSH2_CHANNEL *
|
||||||
libssh2_scp_send_ex(LIBSSH2_SESSION * session, const char *path, int mode,
|
scp_send(LIBSSH2_SESSION * session, const char *path, int mode,
|
||||||
size_t size, long mtime, long atime)
|
size_t size, long mtime, long atime)
|
||||||
{
|
{
|
||||||
int cmd_len;
|
int cmd_len;
|
||||||
unsigned const char *base;
|
unsigned const char *base;
|
||||||
@ -1022,3 +1037,17 @@ libssh2_scp_send_ex(LIBSSH2_SESSION * session, const char *path, int mode,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* libssh2_scp_send_ex
|
||||||
|
*
|
||||||
|
* Send a file using SCP
|
||||||
|
*/
|
||||||
|
LIBSSH2_API LIBSSH2_CHANNEL *
|
||||||
|
libssh2_scp_send_ex(LIBSSH2_SESSION *session, const char *path, int mode,
|
||||||
|
size_t size, long mtime, long atime)
|
||||||
|
{
|
||||||
|
LIBSSH2_CHANNEL *ptr;
|
||||||
|
BLOCK_ADJUST_ERRNO(ptr, session,
|
||||||
|
scp_send(session, path, mode, size, mtime, atime));
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user