Platforms to show: All Mac Windows Linux Cross-Platform

CURLSMBS.DebugMessage(infotype as integer, data as string)
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: A debug event to get data of ongoing process.
Notes:
You may need to set OptionVerbose to true.

infotype constants:
kInfo_TEXT0The data is informational text.
kInfo_HEADER_IN1The data is header (or header-like) data received from the peer.
kInfo_HEADER_OUT2The data is header (or header-like) data sent to the peer.
kInfo_DATA_IN3The data is protocol data received from the peer.
kInfo_DATA_OUT4The data is protocol data sent to the peer.
kInfo_SSL_DATA_IN5The data is protocol data received from the peer.
kInfo_SSL_DATA_OUT6The data is protocol data sent to the peer.
CURLSMBS.Header(data as string) as integer
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: New Header data was received.
Notes:
You can get error 23 if you don't return lenb(data) in this event.
Or just leave it emtpy so RB will not include it in your application the plugin will return lenb(data) itself.
CURLSMBS.Progress(dltotal as double, dlnow as double, ultotal as double, ulnow as double) as boolean
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: An event to report progress of ongoing transfers.
Notes:
This function gets called by libcurl with a frequent interval during operation (roughly once per second) no matter if data is being transfered or not. Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0).
Returning a true from this event will cause libcurl to abort the transfer and return kError_ABORTED_BY_CALLBACK.

You can run CURL from a thread to download several things at the same time or keep the GUI more responsive. For better GUI, you can even call a method like app.DoEvents to get the GUI updated more often.
CURLSMBS.Read(count as integer) as string
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: This event gets called by libcurl as soon as it needs to read data in order to send it to the peer.
Notes:
Return the number of bytes requested. Never return a string with lenb(string)>count. You can return 0 to inform about end of file.

If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've told you will upload N bytes and you upload less than N bytes), you may experience that the server "hangs" waiting for the rest of the data that won't come.

The read event may return CURL_READFUNC_ABORT (&h10000000) to stop the current operation immediately, resulting in a kError_ABORTED_BY_CALLBACK error code from the transfer (Added in 7.12.1)

This event is not called when using PerformMT.
CURLSMBS.RestartRead() as boolean
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: An event to inform you that reading on the file needs to start at the beginning again.
Notes:
Return true on success.
If you use a binarystream for reading you will have to set position to 0 in this event.

This event is not called when using PerformMT.
CURLSMBS.Seek(pos as Int64, whence as integer) as Integer
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 12.2, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: Called when CURL needs to perform a seek.
Notes:
Normally only needed if you resume a download (Seek forward) or upload is reset (seek back).
Whence is kSeekOriginCurrent, kSeekOriginEnd or kSeekOriginSet.
Please return one of this constants: kSeekReturnCantSeek, kSeekReturnFail or kSeekReturnOk.
CURLSMBS.SSHKey(KnownKey as string, KnownKeyLength as integer, KnownKeyType as integer, FoundKey as string, FoundKeyLength as integer, FoundKeyType as integer, MatchStatus as integer) as integer
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 10.0, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: The event for known hosts callback for SFTP and SCP.
Notes:
KnownKey: The known key as string encoded with base64 if KnownKeyLength is zero, otherwise the "raw" data.
KnownKeyLength: The length of the key. Zero for base64 encoded key.
KnownKeyType: The type of the key. (0 = Unknown, 1 = RSA1, 2 = RSA, 3 = DSS)
FoundKey: The found key as string encoded with base64 if FoundKeyLength is zero, otherwise the "raw" data.
FoundKeyLength: The length of the key. Zero for base64 encoded key.
FoundKeyType: The type of the key. (0 = Unknown, 1 = RSA1, 2 = RSA, 3 = DSS)
MatchStatus: The status CURL found. (0 = OK, 1 = Mismatch, 2 = Missing)

Return one of the following values:
CURLKHSTAT_FINE_ADD_TO_FILE0Fine and add to file
CURLKHSTAT_FINE1Fine
CURLKHSTAT_REJECT2reject the connection, return an error
CURLKHSTAT_DEFER3do not accept it, but we can't answer right now so this causes a CURLE_DEFER error but otherwise the connection will be left intact etc
CURLSMBS.Write(data as string) as integer
event, CURL, MBS Real Studio CURL Plugin (CURLS), class CURLSMBS,
Plugin version: 9.8, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: No, Feedback.

Function: This event gets called by libcurl as soon as there is data received that needs to be saved.
Notes:
Return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library and it will abort the transfer and return kError_WRITE_ERROR.

This function may be called with zero bytes data if the transfered file is empty.

The event function will be passed as much data as possible in all invokes, but you cannot possibly make any assumptions. It may be one byte, it may be thousands. The maximum amount of data that can be passed to the write callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (16384).

Next items

The items on this page are in the following plugins: MBS Real Studio CURL Plugin.




Links
MBS Xojo Plugins