"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/smb.c" between
curl-7.65.3.tar.xz and curl-7.66.0.tar.xz

About: cURL is a powerful commandline tool to transfer data from or to a server, using one of the supported protocols HTTP(S), FTP(S), SCP, SFTP, TFTP, DICT, TELNET, LDAP(S) or FILE.

smb.c  (curl-7.65.3.tar.xz):smb.c  (curl-7.66.0.tar.xz)
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2014, Bill Nagel <wnagel@tycoint.com>, Exacq Technologies * Copyright (C) 2014, Bill Nagel <wnagel@tycoint.com>, Exacq Technologies
* Copyright (C) 2016-2018, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2016-2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
skipping to change at line 67 skipping to change at line 67
/* Local API functions */ /* Local API functions */
static CURLcode smb_setup_connection(struct connectdata *conn); static CURLcode smb_setup_connection(struct connectdata *conn);
static CURLcode smb_connect(struct connectdata *conn, bool *done); static CURLcode smb_connect(struct connectdata *conn, bool *done);
static CURLcode smb_connection_state(struct connectdata *conn, bool *done); static CURLcode smb_connection_state(struct connectdata *conn, bool *done);
static CURLcode smb_do(struct connectdata *conn, bool *done); static CURLcode smb_do(struct connectdata *conn, bool *done);
static CURLcode smb_request_state(struct connectdata *conn, bool *done); static CURLcode smb_request_state(struct connectdata *conn, bool *done);
static CURLcode smb_done(struct connectdata *conn, CURLcode status, static CURLcode smb_done(struct connectdata *conn, CURLcode status,
bool premature); bool premature);
static CURLcode smb_disconnect(struct connectdata *conn, bool dead); static CURLcode smb_disconnect(struct connectdata *conn, bool dead);
static int smb_getsock(struct connectdata *conn, curl_socket_t *socks, static int smb_getsock(struct connectdata *conn, curl_socket_t *socks);
int numsocks);
static CURLcode smb_parse_url_path(struct connectdata *conn); static CURLcode smb_parse_url_path(struct connectdata *conn);
/* /*
* SMB handler interface * SMB handler interface
*/ */
const struct Curl_handler Curl_handler_smb = { const struct Curl_handler Curl_handler_smb = {
"SMB", /* scheme */ "SMB", /* scheme */
smb_setup_connection, /* setup_connection */ smb_setup_connection, /* setup_connection */
smb_do, /* do_it */ smb_do, /* do_it */
smb_done, /* done */ smb_done, /* done */
skipping to change at line 610 skipping to change at line 609
smb_format_message(conn, &msg->h, SMB_COM_WRITE_ANDX, smb_format_message(conn, &msg->h, SMB_COM_WRITE_ANDX,
sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size); sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size);
return smb_send(conn, sizeof(*msg), (size_t) upload_size); return smb_send(conn, sizeof(*msg), (size_t) upload_size);
} }
static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg) static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg)
{ {
struct smb_conn *smbc = &conn->proto.smbc; struct smb_conn *smbc = &conn->proto.smbc;
CURLcode result; CURLcode result;
*msg = NULL; /* if it returns early */
/* Check if there is data in the transfer buffer */ /* Check if there is data in the transfer buffer */
if(!smbc->send_size && smbc->upload_size) { if(!smbc->send_size && smbc->upload_size) {
size_t nread = smbc->upload_size > conn->data->set.upload_buffer_size ? size_t nread = smbc->upload_size > conn->data->set.upload_buffer_size ?
conn->data->set.upload_buffer_size : conn->data->set.upload_buffer_size :
smbc->upload_size; smbc->upload_size;
conn->data->req.upload_fromhere = conn->data->state.ulbuf; conn->data->req.upload_fromhere = conn->data->state.ulbuf;
result = Curl_fillreadbuffer(conn, nread, &nread); result = Curl_fillreadbuffer(conn, nread, &nread);
if(result && result != CURLE_AGAIN) if(result && result != CURLE_AGAIN)
return result; return result;
skipping to change at line 939 skipping to change at line 939
static CURLcode smb_disconnect(struct connectdata *conn, bool dead) static CURLcode smb_disconnect(struct connectdata *conn, bool dead)
{ {
struct smb_conn *smbc = &conn->proto.smbc; struct smb_conn *smbc = &conn->proto.smbc;
(void) dead; (void) dead;
Curl_safefree(smbc->share); Curl_safefree(smbc->share);
Curl_safefree(smbc->domain); Curl_safefree(smbc->domain);
Curl_safefree(smbc->recv_buf); Curl_safefree(smbc->recv_buf);
return CURLE_OK; return CURLE_OK;
} }
static int smb_getsock(struct connectdata *conn, curl_socket_t *socks, static int smb_getsock(struct connectdata *conn, curl_socket_t *socks)
int numsocks)
{ {
if(!numsocks)
return GETSOCK_BLANK;
socks[0] = conn->sock[FIRSTSOCKET]; socks[0] = conn->sock[FIRSTSOCKET];
return GETSOCK_READSOCK(0) | GETSOCK_WRITESOCK(0); return GETSOCK_READSOCK(0) | GETSOCK_WRITESOCK(0);
} }
static CURLcode smb_do(struct connectdata *conn, bool *done) static CURLcode smb_do(struct connectdata *conn, bool *done)
{ {
struct smb_conn *smbc = &conn->proto.smbc; struct smb_conn *smbc = &conn->proto.smbc;
*done = FALSE; *done = FALSE;
if(smbc->share) { if(smbc->share) {
 End of changes. 5 change blocks. 
8 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)