-
Content Count
1702 -
Joined
-
Last visited
-
Days Won
32
Posts posted by Angus Robertson
-
-
The ICS TSslHttpRest component now has proper support for multipart/form-data parameters, using TRestParams, available in SVN and the overnight zip. There is a new content type for FormData
and a new method AddItemFile that allows one or more files to be added as parameters.
The OverbyteIcsSnippets sample has two new HTTP file uploads buttons, one doing a simple file upload, the second a form-data upload, which set-ups the parameters as follows:
MyJsonParams := TRestParams.Create(self);
MyJsonParams.PContent := PContJson;
MyJsonParams.AddItem('FileTitle', mytitle);
MyJsonParams.AddItem('FileName', myfile);
SslHttpRest.RestParams.PContent := PContFormData;
SslHttpRest.RestParams.AddItem('FileTitle', mytitle);
SslHttpRest.RestParams.AddItemA('JsonBlock', MyJsonParams.GetParameters, true);
SslHttpRest.RestParams.AddItemFile('FileName', mysrcfile, 0);
SslHttpRest.RestParams.AddItem('Submit', 'SubmitFile');
SslHttpRest.HttpUploadStrat := HttpUploadNone;
StatCode := SslHttpRest.RestRequest(httpPOST, myurl, False, '');This part was relatively straight forward, but testing proved interesting, particularly with an 8Gbyte file. The ICS application web server read uploaded data in a memory buffer, so that was changed for file stream above a certain size, likewise TRestParams needed a file stream for size. Then our form handling code needed updating for character sets as recommended by the latest RFC with a new parameter display web page in the ICS web server samples for testing.
So a long process, but much improved REST functionality.
Angus
- 1
-
Further to the announcement of RAD Studio 12.0 Athens today, ICS V9.,0 already has packages to install on Delphi 12, and is available now from GetIt.
If installing VCL only manually, the overnight zip has a new D12InstallVcl.groupproj that replaces the old D12Install.groupproj, or use the existing combined D12InstallVclFmx.groupproj and just don't install the FMX packages (which is exactly what the new group does).
This change will be made for all compilers for V9.1 and will remove a lot of VCL only packages that are a pain to maintain.
Angus
-
QuoteAnd how do you think the server would address those parameters?
The server can enumerate the parameters sequentially, rather than by accessing them by name, I just added a function to ICS to do exactly that, for diagnostic purposes.
But comma separated values could be used as an array. It all depends on what the server expects, and it may not follow normal standards.
Angus
-
You could look at https://github.com/mtrojnar/osslsigncode OpenSSL based Authenticode signing for PE/MSI/Java CAB files,
There must be some code in there to add the certificate to the exe, or maybe the whole tool is what you are looking for, an alternate to signcode that does not have horrible pop-ups, builds on any platform.
If you can build it, I'd like to play with it.
Angus
-
I would recommend you upgrade to the latest ICS V9.0, there were a number of fixes relating to objects not being freed after exceptions, lots of clean-up, particularly for Win64 servers.
There is no general problem with the ICS web server crashing, the following is from the status page of one of my public ICS web servers, doing SQL queries, REST requests and standard web pages, it just keeps running, until time for Windows Update or a new version:
WSocket: TWSocket (c) 1996-2023 Francois Piette V9.1
Server: THttpServer (c) 1999-2023 F. Piette V9.0
Windows Boot Time: 10-Oct-2023 21:54:24
WebAppTelecom Start Time: 10-Oct-2023 22:54:27
Server OS: Windows Server 2019 Standard 1809 Win64 10.0.17763
Compiler: Delphi 11.3 Win64
OpenSSL Version: Static OpenSSL 3.0.11 19 Sep 2023, Legacy Provider Loaded OK
SQL Requests: 49,572
Total Requests: 104,933
Total Connections: 117,470
Max Simultaneous Connections: 60
Total Data Received: 73.7M
Total Data Transmitted: 3.03G
Angus
-
Look at the new OverbyteNetTools sample, the LAN Devices tab scans the LAN for devices in various ways and shows the MAC vendor, often useful for identifying all those IoT devices that our LAN seem to accumulate, often announcing themselves as Amazon or Google, NEST, Tuya, Espressif, and others, just on my LAN. For reasons unknown, they sometimes change MAC address to something random and back again.
Angus
-
ICS has a simple functon IcsGetMacVendor that loads the tab separated https://linuxnet.ca/ieee/oui/nmap-mac-prefixes list into a simple TStringList, sorts it, then accesses by partial Find, very quick, simple and efficient. It also checks for randomly generated MACs that fail look-up and report that.
Angus -
I can not trace route ptbtime1.ptb.de (192.53.103.108) from the UK, no response to any hops beyond my ISP.
The time client does seem unhappy with IPv6 time servers, it's failing on all the Google IPv6 addresses before trying the IPv4 ones and working. Ditto Cloudfare, will check later in the week.
I mostly use time.cloudflare.com now, well distributed around the world, but not Google. But Facebook and Apple also have distributed servers, all are better than the random addresses that come back for ?.ntp.org.
Angus
-
Sorry, I don't have the time to debug end user applications, only fix proven reproducible problems in the ICS components.
Angus
-
No-one has ever sent me a Telegram message, but I don't have it installed either. WhatsApp is however widely used, but does not have an official API for the consumer version.
But RCS is being installed automatically, although perhaps not enabled by default, and will fall back to SMS, which is universal.
Angus
-
Sorry, no simple answer, something your own code is doing is corrupting memory, so the client can not be freed correctly. Or a function being called from the client. No easy way to find the problem. Perhaps comment out various parts of the code until the problem disappears to narrow it down.
Angus
-
If you get an exception in that function, your application has probably already freed the client, although the exception should have happened a few lines higher. But it could also be memory corruption.
If you have recently converted your application from Delphi 7 AnsiStrings to Unicode, I would look very carefully at all your string handling for received data.
Angus
-
Thanks for the information, but you have not explained what the clients are doing. And I'm still confused as to why you think clients being disconnected when idle is a bad thing, that is the design.
If you want idle clients to remain connected, set long KeepAlive timeouts, several hours. Zero for no disconnect is not documented as a design feature.,
The ICS web server is well tested over 20 years, in use on many public web servers, including my own.
Angus
-
I'd like to know for what purpose you are using the ICS web server, what application, and why you are trying to disable server timeouts with
WebServerSSL.KeepAliveTimeSec := 0;
WebServerSSL.KeepAliveTimeXferSec := 0;Web servers are not supposed to keep idle connections opens unless keep-alive is requested. The Heartbeat timer should ignore zero timeouts, but I've never tested it, since no-one needs that feature.
Also, you sometimes mention the connection being closed, sometimes the web server, which seems highly unlikely.
Angus
-
You have shown an extract from a long function, if there was an error the connection will be disconnected anyway.
The handshake event is called merely to allow the application to know there was a failure and report it to the end user.
Angus
-
Permissions, always, they are complex to set-up in Azure and use in code. In particular, consumer and business accounts are different, the latter need a Microsoft User Authority to be passed and enabled, And the scopes specified when you got the bearer token must match those set-up for the account.
Angus
-
Has anyone looked at the Google RBM (Rich Business Messaging) APIs, used for the SMS replacement RCS Chats that seems to be appearing on all our phones? Personally, I'd missed it, just use Whatsapp.
Not sure if RBM is the same as RCS, don't really follow mobile trends...
But receiving and sending RCS from my desktop without needing to forward SMS would seem useful.
Angus
-
Quoteall my base visual components are based on the TNT Unicode library
I had to remove a lot of TNT components during my conversions. I would start your conversion in Delphi 7, made sure all your forms are saved as text, then use a text editor to globally replace TNT components one form at a time in PAS and DFM, with standard VCL versions, so it builds, but won't run properly. Then open in a modern compiler. Maybe change WideString to UnicodeString, or perhaps you have an alias already.
Angus
-
QuoteSince whatever string that needed to support unicode is already defined as "WideString", I thought of doing a blind search and replace from "String" to "AnsiString"
Widestring and Unicodestring are not the same thing, despite both being 16-bit. You really need to change Widestring to Strimg sooner or later. And beware of ansistring as I said before.
Angus
-
Over the last two years, I've converting Delphi 2007 applications to modern compilers. Not finished yet.
Apart from all the other comments made, a couple of my own.
Avoid the simple solution of using AnsiString, you will end up with thousands of compiler cast warning and have trouble with functions that use UnicodeString. Use TBytes for non-string data, there are lots of ways of converting TB to other formats
Look at file handling carefully, loading a text file into a TStringList will result in Chinese as it assumes it's reading unicode, unless it finds a BOM or is told otherwise, ditto saving files.
Angus
- 1
-
You are looking at a low level component where you'd need to code all that stuff yourself.
Please use TIcsFtpMulti instead, which reads directories automatically and downloads or uploads multiple files with a single function call. The main sample is OverbyteIcsXferTst, but there also is a very simple sample in OverbyteIcsSnippets where you can press a button to download sample files.
Angus
-
Can you please answer the several questions I have previously asked, rather than just repeating one of the symptoms of your problem?
Angus
-
Simple XOR encryption with a numeric key will make it much harder to search the EXE for client ID and passwords, AES if you don't care about the size overhead.
Angus
-
> ICS can not start, because some necessary SSL DLLs are missing.
Because you failed to distribute all the required files with your prorgram.
> ICS is trying to download those DLLs from a non-SSL server via http://... , but can not !!!
Because you told the ICS application you designed to do an impossible download. Bad program design.
Before distributing applications to hundreds of PCs, I find a little testing helps.
Angus
Delphi 12 is available
in Delphi IDE and APIs
Posted
I had Delphi 11.3 and 12.0 installed together for a week, Parnassus only installed in 11.3, no problems.
But when I updated the license key for 12.0 yesterday, 11,3 stopped working. So I guess Parnassus has screwed me as well.
Parnassus only works with a subscription license key, not beta keys, which is why the problem did not show up earlier. Annoying.
Angus