return ftp_code;
}
-/* Read |len| from the socket |fd| and store it in |to|. Return a
- CURLcode saying whether an error occured or CURLE_OK if |len| was read. */
+/* Read |len| from the socket |fd| and store it in |to|. Return a CURLcode
+ saying whether an error occured or CURLE_OK if |len| was read. */
static CURLcode
socket_read(curl_socket_t fd, void *to, size_t len)
{
/* Write |len| bytes from the buffer |to| to the socket |fd|. Return a
- CURLcode saying whether an error occured or CURLE_OK if |len| was written. */
+ CURLcode saying whether an error occured or CURLE_OK if |len| was
+ written. */
static CURLcode
-socket_write(struct connectdata *conn, curl_socket_t fd, const void *to, size_t len)
+socket_write(struct connectdata *conn, curl_socket_t fd, const void *to,
+ size_t len)
{
const char *to_p = to;
CURLcode code;
ret = socket_read(fd, buf->data, len);
if (ret != CURLE_OK)
return ret;
- buf->size = (conn->mech->decode)(conn->app_data, buf->data, len,
- conn->data_prot, conn);
+ buf->size = conn->mech->decode(conn->app_data, buf->data, len,
+ conn->data_prot, conn);
buf->index = 0;
return CURLE_OK;
}
else
prot_level = conn->command_prot;
}
- bytes = (conn->mech->encode)(conn->app_data, from, length, prot_level,
- (void**)&buffer, conn);
+ bytes = conn->mech->encode(conn->app_data, from, length, prot_level,
+ (void**)&buffer, conn);
if(iscmd) {
bytes = Curl_base64_encode(conn->data, buffer, bytes, &cmd_buffer);
if(bytes > 0) {
ssize_t len = conn->buffer_size;
int tx = 0;
- len -= (conn->mech->overhead)(conn->app_data, conn->data_prot, len);
+ len -= conn->mech->overhead(conn->app_data, conn->data_prot, len);
if(len <= 0)
len = length;
while(length) {
return -1;
}
- decoded_len = (conn->mech->decode)(conn->app_data, buf, decoded_len,
- level, conn);
+ decoded_len = conn->mech->decode(conn->app_data, buf, decoded_len,
+ level, conn);
if(decoded_len <= 0) {
free(buf);
return -1;
}
/* Authenticate */
- ret = ((*mech)->auth)(conn->app_data, conn);
+ ret = (*mech)->auth(conn->app_data, conn);
if(ret == AUTH_CONTINUE)
continue;
{
if(conn->mech != NULL) {
if(conn->mech->end)
- (conn->mech->end)(conn->app_data);
- /* FIXME: Why do we zero'd it before free'ing it? */
- memset(conn->app_data, 0, conn->mech->size);
+ conn->mech->end(conn->app_data);
free(conn->app_data);
conn->app_data = NULL;
}