Skip to content

Commit

Permalink
removed some unused variables, integrated missing function definition…
Browse files Browse the repository at this point in the history
… into generic/tclcurl.h
  • Loading branch information
mxmanghi committed Aug 14, 2024
1 parent a2079dd commit a26edc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
6 changes: 2 additions & 4 deletions generic/tclcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,8 +2783,8 @@ curlWriteProcInvoke(void *ptr,size_t size,size_t nmemb,FILE *curlDataPtr) {
curl_retcode = -1;
}
for (i = 0; i <= cmd_list_size; i++) { Tcl_DecrRefCount(objList[i]); }
Tcl_Free(objList);
Tcl_Free(argvPtr);
Tcl_Free((char *)objList);
Tcl_Free((char *)argvPtr);
return curl_retcode;
}

Expand Down Expand Up @@ -3856,7 +3856,6 @@ curlVersionInfo (ClientData clientData, Tcl_Interp *interp,
int i;
curl_version_info_data *infoPtr;
Tcl_Obj *resultObjPtr=NULL;
char tmp[7];

if (objc!=2) {
resultObjPtr=Tcl_NewStringObj("usage: curl::versioninfo -option",-1);
Expand Down Expand Up @@ -4147,7 +4146,6 @@ curlCloseFiles(struct curlObjData *curlData) {
int
curlOpenFile(Tcl_Interp *interp,char *fileName, FILE **handle, int writing, int text) {
Tcl_Obj *resultObjPtr;
char errorMsg[300];

#ifdef _WIN32
Tcl_DString nativeString;
Expand Down
21 changes: 16 additions & 5 deletions generic/tclcurl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*
*/

#ifndef tclcurl_h
#define tclcurl_h

#if (defined(WIN32) || defined(_WIN32))
#define CURL_STATICLIB 1
#endif
Expand Down Expand Up @@ -198,6 +201,7 @@ CONST static char *optionTable[] = {
"CURLOPT_FNMATCH_PROC", "CURLOPT_RESOLVE", "CURLOPT_TLSAUTH_USERNAME",
"CURLOPT_TLSAUTH_PASSWORD", "CURLOPT_TLSAUTH_TYPE", "CURLOPT_TRANSFER_ENCODING",
"CURLOPT_GSSAPI_DELEGATION", "CURLOPT_NOPROXY", "CURLOPT_TELNETOPTIONS",
"CURLOPT_CAINFO_BLOB",
(char *)NULL
};

Expand Down Expand Up @@ -239,11 +243,11 @@ CONST static char *configTable[] = {
"-share", "-port", "-tcpnodelay",
"-autoreferer", "-sourcehost", "-sourceuserpwd",
"-sourcepath", "-sourceport", "-pasvhost",
"-sourceprequote", "-sourcepostquote", "-ftpsslauth",
"-sourceurl", "-sourcequote", "-ftpaccount",
"-ignorecontentlength", "-cookielist",
"-ftpskippasvip", "-ftpfilemethod", "-localport",
"-localportrange",
"-sourceprequote", "-sourcepostquote",
"-ftpsslauth", "-sourceurl", "-sourcequote",
"-ftpaccount", "-ignorecontentlength",
"-cookielist", "-ftpskippasvip",
"-ftpfilemethod", "-localport", "-localportrange",
"-maxsendspeed", "-maxrecvspeed",
"-ftpalternativetouser", "-sslsessionidcache",
"-sshauthtypes", "-sshpublickeyfile", "-sshprivatekeyfile",
Expand All @@ -263,6 +267,7 @@ CONST static char *configTable[] = {
"-fnmatchproc", "-resolve", "-tlsauthusername",
"-tlsauthpassword", "-tlsauthtype", "-transferencoding",
"-gssapidelegation", "-noproxy", "-telnetoptions",
"-cainfoblob",
(char *) NULL
};

Expand Down Expand Up @@ -421,6 +426,8 @@ int SetoptCurlOffT(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,int tableI
Tcl_Obj *tclObj);
int SetoptChar(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,
int tableIndex,Tcl_Obj *tclObj);
int SetoptBlob(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,
int tableIndex,Tcl_Obj *tclObj);
int SetoptSHandle(Tcl_Interp *interp,CURL *curlHandle,CURLoption opt,
int tableIndex,Tcl_Obj *tclObj);
int SetoptsList(Tcl_Interp *interp,struct curl_slist **slistPtr,Tcl_Obj *CONST objv);
Expand Down Expand Up @@ -495,6 +502,7 @@ int curlShareObjCmd (ClientData clientData, Tcl_Interp *interp,
int objc,Tcl_Obj *CONST objv[]);
int curlCleanUpShareCmd(ClientData clientData);

#ifndef multi_h
#ifdef TCL_THREADS
TCL_DECLARE_MUTEX(cookieLock)
TCL_DECLARE_MUTEX(dnsLock)
Expand All @@ -505,6 +513,7 @@ int curlCleanUpShareCmd(ClientData clientData);
, curl_lock_access access, void *userptr);
void curlShareUnLockFunc(CURL *handle, curl_lock_data data, void *userptr);
#endif
#endif

int curlErrorStrings (Tcl_Interp *interp, Tcl_Obj *CONST objv,int type);
int curlEasyStringError (ClientData clientData, Tcl_Interp *interp,
Expand All @@ -517,3 +526,5 @@ int curlMultiStringError (ClientData clientData, Tcl_Interp *interp,
#ifdef __cplusplus
}
#endif

#endif

0 comments on commit a26edc2

Please sign in to comment.