Unverified Commit 73af7bcd authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

smb_getsock: always wait for write socket too

... the protocol is doing read/write a lot, so it needs to write often
even when downloading. A more proper fix could check for eactly when it
wants to write and only ask for it then.

Without this fix, an SMB download could easily get stuck when the event-driven
API was used.

Closes #2768
parent 7bc11804
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -941,17 +941,11 @@ 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)
                       int numsocks)
{
{
  struct smb_conn *smbc = &conn->proto.smbc;

  if(!numsocks)
  if(!numsocks)
    return GETSOCK_BLANK;
    return GETSOCK_BLANK;


  socks[0] = conn->sock[FIRSTSOCKET];
  socks[0] = conn->sock[FIRSTSOCKET];

  return GETSOCK_READSOCK(0) | GETSOCK_WRITESOCK(0);
  if(smbc->send_size || smbc->upload_size)
    return GETSOCK_WRITESOCK(0);

  return GETSOCK_READSOCK(0);
}
}


static CURLcode smb_parse_url_path(struct connectdata *conn)
static CURLcode smb_parse_url_path(struct connectdata *conn)