mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net.http: fix crash on Windows when using Boehm GC (#14351)
This commit is contained in:
parent
940c78bdfd
commit
9e09b709e3
2
thirdparty/vschannel/vschannel.c
vendored
2
thirdparty/vschannel/vschannel.c
vendored
@ -877,7 +877,7 @@ static SECURITY_STATUS https_make_request(TlsContext *tls_ctx, CHAR *req, CHAR *
|
|||||||
// increase buffer size if we need
|
// increase buffer size if we need
|
||||||
int required_length = *length+(int)pDataBuffer->cbBuffer;
|
int required_length = *length+(int)pDataBuffer->cbBuffer;
|
||||||
if( required_length > buff_size ) {
|
if( required_length > buff_size ) {
|
||||||
CHAR *a = realloc(*out, required_length);
|
CHAR *a = VSCHANNEL_REALLOC(*out, required_length);
|
||||||
if( a == NULL ) {
|
if( a == NULL ) {
|
||||||
scRet = SEC_E_INTERNAL_ERROR;
|
scRet = SEC_E_INTERNAL_ERROR;
|
||||||
return scRet;
|
return scRet;
|
||||||
|
4
thirdparty/vschannel/vschannel.h
vendored
4
thirdparty/vschannel/vschannel.h
vendored
@ -20,6 +20,10 @@
|
|||||||
// Define here to be sure
|
// Define here to be sure
|
||||||
#define SP_PROT_TLS1_2_CLIENT 0x00000800
|
#define SP_PROT_TLS1_2_CLIENT 0x00000800
|
||||||
|
|
||||||
|
#if !defined(VSCHANNEL_REALLOC)
|
||||||
|
#define VSCHANNEL_REALLOC realloc
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct TlsContext TlsContext;
|
typedef struct TlsContext TlsContext;
|
||||||
|
|
||||||
TlsContext new_tls_context();
|
TlsContext new_tls_context();
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
module http
|
module http
|
||||||
|
|
||||||
|
$if gcboehm ? {
|
||||||
|
#define VSCHANNEL_REALLOC GC_REALLOC
|
||||||
|
}
|
||||||
|
|
||||||
#flag windows -I @VEXEROOT/thirdparty/vschannel
|
#flag windows -I @VEXEROOT/thirdparty/vschannel
|
||||||
#flag -l ws2_32 -l crypt32 -l secur32 -l user32
|
#flag -l ws2_32 -l crypt32 -l secur32 -l user32
|
||||||
#include "vschannel.c"
|
#include "vschannel.c"
|
||||||
|
Loading…
Reference in New Issue
Block a user