Platforms to show: All Mac Windows Linux Cross-Platform
Back to CURLSMBS class.
CURLSMBS.ChunkBegin(FileInfo as CURLSFileInfoMBS, Remains as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 15.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
If splitting of data transfer is enabled, this event is called before download of an individual chunk started. Note that parameter "remains" works only for FTP wildcard downloading (for now), otherwise is not used.
CURLSMBS.ChunkEnd(FileInfo as CURLSFileInfoMBS, Remains as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 15.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
If splitting of data transfer is enabled this event is called after download of an individual chunk finished.
This event is called for skipped or downloaded files.
CURLSMBS.DebugMessage(infotype as Integer, data as string, dataSize as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
You may need to set OptionVerbose to true.
infotype constants:
kInfo_TEXT | 0 | The data is informational text. |
kInfo_HEADER_IN | 1 | The data is header (or header-like) data received from the peer. |
kInfo_HEADER_OUT | 2 | The data is header (or header-like) data sent to the peer. |
kInfo_DATA_IN | 3 | The data is protocol data received from the peer. |
kInfo_DATA_OUT | 4 | The data is protocol data sent to the peer. |
kInfo_SSL_DATA_IN | 5 | The data is protocol data received from the peer. |
kInfo_SSL_DATA_OUT | 6 | The data is protocol data sent to the peer. |
If you set CollectDebugMessages, the plugin will collect the messages and provide them via the DebugMessages property. You can still use this event to write your own log instead of in addition.
CURLSMBS.FileNameMatch(Pattern as String, Name as String) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 15.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
If you don't implement this event, you get the default implementation from CURL.
Return kFileNameMatchNoMatch, kFileNameMatchIsMatch or kFileNameMatchFailed.
CURLSMBS.Finished(Result as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 15.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
For Perform and PerformMT it is called before Perform function returns, so in PerformMT this is called on the thread.
For use with CURLSMultiMBS, it is called after TransferFinished event and before TransfersFinished event.
If you want to modify GUI and use PeformMT, you may need to start a timer to do so.
CURLSMBS.Header(data as string, dataSize as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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.
If you set CollectHeaderData to true, the plugin will collect the messages and provide them via the HeaderData property. You can still use this event to write your own log instead of in addition.
CURLSMBS.Progress(dltotal as Int64, dlnow as Int64, ultotal as Int64, ulnow as Int64, percent as Double) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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 event 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.
When sending email, ultotal may be zero. In that case use OptionInFileSize to know size of email to upload.
CURLSMBS.Read(count as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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.
If you provide Input data via SetInputData or OpenMTInputFile method, this event is not called and data is taken from the data you provided.
CURLSMBS.RestartRead() as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 12.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 10.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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_FILE | 0 | Fine and add to file |
CURLKHSTAT_FINE | 1 | Fine |
CURLKHSTAT_REJECT | 2 | reject the connection, return an error |
CURLKHSTAT_DEFER | 3 | do 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, dataSize as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | CURL | MBS CURL Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
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 event is defined in the CURL.h header file: CURL_MAX_WRITE_SIZE (16384).
If you set CollectOutputData to true, the plugin will automatically collect the data and provide it to you after the transfer with the OutputData property. This collecting feature will only work right, if there is enough free memory. You can of course still process data yourself in this event instead of in addition.
The items on this page are in the following plugins: MBS CURL Plugin.