mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:53:46 +03:00
CLOSESOCKETFUNCTION: added
Introduced the initial setup to allow closesocket callbacks by making sure sclose() is only ever called from one place in the libcurl source and still run all test cases fine.
This commit is contained in:
parent
d4e000906a
commit
b5d170b551
10 changed files with 71 additions and 25 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "rawstr.h"
|
||||
#include "progress.h"
|
||||
#include "non-ascii.h"
|
||||
#include "connect.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
|
@ -482,7 +483,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||
|
||||
if(closeConnection && data->req.newurl) {
|
||||
/* Connection closed by server. Don't use it anymore */
|
||||
sclose(conn->sock[sockindex]);
|
||||
Curl_closesocket(conn, conn->sock[sockindex]);
|
||||
conn->sock[sockindex] = CURL_SOCKET_BAD;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue