mirror of
https://github.com/curl/curl.git
synced 2026-08-05 09:56:26 +03:00
Curl_GetFTPResponse() takes a different set of parameters and now return a
proper CURLcode. The default timeout for reading one response is now also possible to change while running.
This commit is contained in:
parent
199a0311e2
commit
d0b97f7e1f
5 changed files with 126 additions and 123 deletions
|
|
@ -414,14 +414,14 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||
}
|
||||
|
||||
if(level){
|
||||
int code;
|
||||
if(Curl_ftpsendf(conn, "PBSZ %u", s))
|
||||
return -1;
|
||||
|
||||
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL);
|
||||
if(nread < 0)
|
||||
if(Curl_GetFTPResponse(&nread, conn, &code))
|
||||
return -1;
|
||||
|
||||
if(conn->data->state.buffer[0] != '2'){
|
||||
if(code/100 != '2'){
|
||||
failf(conn->data, "Failed to set protection buffer size.");
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -437,8 +437,7 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||
if(Curl_ftpsendf(conn, "PROT %c", level["CSEP"]))
|
||||
return -1;
|
||||
|
||||
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL);
|
||||
if(nread < 0)
|
||||
if(Curl_GetFTPResponse(&nread, conn, NULL))
|
||||
return -1;
|
||||
|
||||
if(conn->data->state.buffer[0] != '2'){
|
||||
|
|
@ -496,8 +495,7 @@ Curl_sec_login(struct connectdata *conn)
|
|||
if(Curl_ftpsendf(conn, "AUTH %s", (*m)->name))
|
||||
return -1;
|
||||
|
||||
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, &ftpcode);
|
||||
if(nread < 0)
|
||||
if(Curl_GetFTPResponse(&nread, conn, &ftpcode))
|
||||
return -1;
|
||||
|
||||
if(conn->data->state.buffer[0] != '3'){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue