Quantcast
Channel: Chilkat Forum - latest questions
Viewing all 1061 articles
Browse latest View live

imap.search question

$
0
0

Hi, my question belongs to imap.search component.

I'm having a program running which graps all new emails via imap.Search("NEW",1)

The program is not disconnecting from the imap server, instead connection keeps alive so imap.Search is called again and again on every iteration of the program.

The search looks like that:

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaad UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

NEW ITERATION:

0

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaae UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

NEW ITERATION:

0

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaaf UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

I'm confused from the "Command line" in this example like the last command: "aaaf UID SEARCH NEW"

What is this ID doing here?

Because when I'm doing a shutdown of the program, everything will be closed and also a disconnect of the imap server will be done and at that point chilkat is doing some kind of closing? for each search request?!

like that:

aaad OK SEARCH completed.
----IMAP REQUEST----
aaae UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaae OK SEARCH completed.
----IMAP REQUEST----
aaaf UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaaf OK SEARCH completed.
----IMAP REQUEST----
aaag UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaag OK SEARCH completed.
----IMAP REQUEST----
aaah UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaah OK SEARCH completed.
----IMAP REQUEST----
aaai UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaai OK SEARCH completed.
----IMAP REQUEST----
aaaj UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaaj OK SEARCH completed.
----IMAP REQUEST----
aaak UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaak OK SEARCH completed.
----IMAP REQUEST----
aaal UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaal OK SEARCH completed.
----IMAP REQUEST----
aaam UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaam OK SEARCH completed.
----IMAP REQUEST----
aaan UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH 538
* 1 RECENT

As this can take a while (depends on the time the program was running) my questions is how to avoid this?

Thanks a lot!


How to Compute the HMAC-SHA256 Signature for the Plaza API (bol.com)?

$
0
0

How to Compute the HMAC-SHA256 Signature for the Plaza API (bol.com)?

SSH ChannelReceiveUntilMatch() does not work after upgrade

$
0
0

I am attempting to upgrade from ChilkatDotNet4.dll version 9.4.1.0 to 9.5.0.58 but the following code no longer works:

sshCK.SendReqExec(channelNum, "type \remote_host_Bshare_name$data.csv && echo Get_Complete"); sshCK.ChannelReceiveUntilMatch(channelNum, "Get_Complete", "ansi", false);

I am connecting to Windows host A via SSH and then having host A print the contents of a remote file on host B, and then append the keyword "Get_Complete" so I know where the data ends.

Here are my observations:

1) This works fine with 9.4.1.0 (i.e. ChannelReceiveUntilMatch() returns true) 2) If I ignore the error and call GetReceivedText(), the data that is returned is exactly what I expected to receive. 3) I tried playing around with ReadTimeoutMs, but regardless of its value the command always returns in about 25ms.

Has this command changed significantly since 9.4 and I just need to change my logic? Or is there a bug of some kind?

Thanks, Richard

Chilkat error: ChilkatLog:
  ChannelReceiveUntilMatch(16ms):
    DllDate: Jun 13 2016
    ChilkatVersion: 9.5.0.58
    UnlockPrefix: PETERLSSH
    Architecture: Little Endian; 64-bit
    Language: .NET 4.0 / x64
    VerboseLogging: 1
    channelReceiveUntilMatch(16ms):
      channel: 5
      pattern: Get_Complete
      charset: ansi
      caseSensitive: 0
      readChannelData(16ms):
        mType: IGNORE
        mType: CHANNEL_DATA
        dataLen: 80
        clientWinSize: 327600
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 512
        clientWinSize: 327088
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 1024
        clientWinSize: 326064
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 1968
        clientWinSize: 324096
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 512
        clientWinSize: 323584
      --readChannelData
      readChannelData:
        mType: IGNORE
        mType: CHANNEL_DATA
        dataLen: 80
        clientWinSize: 323504
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 944
        clientWinSize: 322560
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 512
        clientWinSize: 322048
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 400
        clientWinSize: 321648
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 512
        clientWinSize: 321136
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 784
        clientWinSize: 320352
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 80
        clientWinSize: 320272
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 784
        clientWinSize: 319488
      --readChannelData
      readChannelData:
        mType: IGNORE
        mType: CHANNEL_DATA
        dataLen: 80
        clientWinSize: 319408
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 1696
        clientWinSize: 317712
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 784
        clientWinSize: 316928
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 1344
        clientWinSize: 315584
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 704
        clientWinSize: 314880
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 912
        clientWinSize: 313968
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 1104
        clientWinSize: 312864
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 2746
        clientWinSize: 310118
      --readChannelData
      readChannelData:
        mType: CHANNEL_DATA
        dataLen: 14
        clientWinSize: 310104
      --readChannelData
      readChannelData:
        mType: IGNORE
        mType: CHANNEL_REQUEST
        Received CHANNEL REQUEST message
        requestType: exit-status
        wantReply: 0
        exitStatusCode: 0
        Received channel request 
      --readChannelData
      readChannelData:
        mType: CHANNEL_EOF
      --readChannelData
      readChannelData:
        mType: CHANNEL_CLOSE
        Sent SSH Channel CLOSE
      --readChannelData
      Failed to receive until match.
    --channelReceiveUntilMatch
    Failed.
  --ChannelReceiveUntilMatch
--ChilkatLog

Method SFTP DownloadFile is downloading 0 KB files

$
0
0

Hi,

Really need some assistance.

We are transitioning from a windows 2008 R2 server to a windows 2012 R2 server. But on the windows 2012 R2 server, the downloaded files are empty (0 KB).

on the windows 2008 R2 server, the file permissions are 0600 which chilkat reads as 33152

on the windows 2012 R2 server, the file permissions are 0666 which chilkat reads as 33206

Below is an example log from chilkat which shows as successful:

ChilkatLog:

DownloadFile: DllDate: Aug 3 2011

UnlockPrefix: NFAFUTSSH

Username: NFISEPE02D:nfisepe

Architecture: Little Endian; 32-bit

Language: ActiveX

SshVersion: SSH-2.0-2.0

SftpVersion: 6

handle: C005000000000000
toFilename: C:\Users\NFISEPE\Documents\Visual Studio Projects\TestChilkat\TestChilkat\bin\SITUATION.docx

tcpNoDelay: 0

FetchRemoteFileAttributes:

  Fetching size-only.

  handle: C005000000000000

  flags: 0x1

  Using FXP_FSTAT

  Sent message to fetch attributes.

  Received SSH_FXP_ATTRS

  unpackSftpVersion: 6

remoteFileSize: 15147

Reached end of remote file.

timeToDownloadFileDataMs: Elapsed time: 31 millisec
Success.

CkFtp2Progress not fire callbacks on Android 6.0

$
0
0

Currently use ftp by follow sample https://www.example-code.com/android/ftp_download_with_progress.asp. It's works fine. But on Android 6.0 CkFtp2Progress callbacks not fire. I'm confused. Help me please. Some piece of code

public void loadFile(final int position, final Config.File file, final OnDownloadFileListener listener, final OnDownloadingProgressListener progressListener) {

asyncManager.runAsync(new Runnable() {

@Override

public void run() {

if(file == null || file.file == null) { sendError("", listener); return; }

            CkFtp2 ftp = getFtpClient();
            CustomProgressWatcher progressWatcher = new CustomProgressWatcher(position, file.size
                    , progressListener);
            ftp.put_EventCallbackObject(progressWatcher);

            //  Connect and login to the FTP server.
            boolean success = ftp.ConnectOnly();
            if (!success) {
                sendError(ftp.lastErrorText(), listener);
                return;
            }

            success = ftp.LoginAfterConnectOnly();
            if (!success) {
                sendError(ftp.lastErrorText(), listener);
                ftp.Disconnect();
                return;
            }

            String localFilename = fileNameProvider.getLocalStorageFileName(file);
            String remoteFilename = fileNameProvider.getRemoteFileName(file);

            //  Change to the remote directory where the file is located.
            //  This step is only necessary if the file is not in the root directory
            //  for the FTP account.
            success = ftp.ChangeRemoteDir("remoteDirName");
            if (!success) {
                L.e(ftp.lastErrorText());
                ftp.Disconnect();
                return;
            }

            //  Download the file.
            success = ftp.GetFile(remoteFilename,localFilename);
            if (!success) {
                sendError(ftp.lastErrorText(), listener);
                ftp.Disconnect();
                return;
            } else {
                L.e("File Downloaded = " + file.file);
            }

            DownloadResult result = new DownloadResult();
            result.result = file;
            sendResult(result, listener);

            ftp.put_EventCallbackObject(null);
            ftp.Disconnect();
        }
    });
}

private CkFtp2 getFtpClient() {
    CkFtp2 ftp = new CkFtp2();
    ftp.put_Hostname(CommonConfig.BASE_URL);
    ftp.put_Username(CommonConfig.USER_NAME);
    ftp.put_Password(CommonConfig.USER_PASSWORD);

    ftp.put_HeartbeatMs(300);

    ftp.put_CrlfMode(2);
    ftp.put_PreferIpv6(true);
    ftp.put_AuthTls(true);
    ftp.put_Passive(true);

    return ftp;
}

public class CustomProgressWatcher extends CkFtp2Progress {

private FTPDownloadManagerImpl.OnDownloadingProgressListener listener;
private int position;
private long onePercent;
private long lastByteCount = 0l;

public CustomProgressWatcher(int position, long fileSize,
                             FTPDownloadManagerImpl.OnDownloadingProgressListener listener) {
    this.position = position;
    this.listener = listener;
    onePercent = fileSize / 100;
}

@Override
public void DownloadRate(final long byteCount, long bytesPerSec) {
    super.DownloadRate(byteCount, bytesPerSec);
    final long completion = byteCount / onePercent;
    final long byteTransfered = byteCount - lastByteCount;
    lastByteCount = byteCount;

    L.e("byteCount = " + byteCount);
    new Handler(Looper.getMainLooper()).post(new Runnable() {
        @Override
        public void run() {
            if (listener != null) {
                listener.onProgress(completion, position);
                listener.onByteCount(byteTransfered);
            }
        }
    });
}

}

C++ predicting wrong charset

$
0
0

Hi guys, I'm having some issues when getting an email without the charset specified in the content-type header. The charset is being predicted as "charset="iso-8859-1"" when, for this particular email (containing german characters), it should be utf-8.

This happens by using CkEamil::getMime() (I really need to use this method to later process)

-Is there a way to get the raw charset ? (the one without the predicted charset) -can we distingwish if it was predicted ?

Thx !

PublicKey LoadFromFile return 0

$
0
0

Using PublicKey metode:

loo_PubKey2.LoadFromFile('C:\Temp\abc.pem')

loo_PubKey2.LastErrorText

return this:

ChilkatLog:
  LoadFromFile(16ms):
    DllDate: Jun 13 2016
    ChilkatVersion: 9.5.0.58
    UnlockPrefix: Anything for 30-day trial
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 1
    loadAnyFormat(16ms):
      loadPem(16ms):
        loadPem2(16ms):
          loadPem(16ms):
            itemType: CERTIFICATE
            addPemItem(16ms):
              itemType: CERTIFICATE
              addCertificate(16ms):
                addCertificate(16ms):
                  certHashEntryB: 356E5DB89EF1B6F9B0779A8E6E64DD96:Certum Level IV CA
                  skiHashKey: SubjectKeyId:5xONbbkk+qlL44K12GhP7G2zxsI=
                --addCertificate
              --addCertificate
            --addPemItem
            No more -----BEGIN's found.
          --loadPem
        --loadPem2
      --loadPem
    --loadAnyFormat
    Failed.
  --LoadFromFile
--ChilkatLog

the file C:\Temp\abc.pem is good.

What are the actual bytes that are encrypted when a string is encrypted?

$
0
0

Can you please clarify?

  1. Using CkCrypt2W
  2. AES block size for IV is 16 bytes
  3. Hex encoded block (from sample): 000102030405060708090A0B0C0D0E0F

Is it okay to pass as HEX encoded unicode? Does it strip out the zeros?

For example, if my "block" was 3 bytes of all AAA hex encoded is 414141.

Do you pass L"414141" which is actually 16-bytes "410041004100". If the IV was block size of 2 would it just use 4100->A or would it internally process 414141->AAA?

Hope this makes sense. Basically I'm asking if the AES block is 16 bytes:

  1. Do I pass a Unicode encoded hex string (like 410041) or ANSI encoded as unicodeString (L"4141")?

  2. Internally maybe it is converting the L"414141" to utf8 414141?

Just wanted to verify.


Asynchronous Methods in VB6 - Be Very Careful with Callbacks

$
0
0

When an asynchronous Chilkat method is called, callbacks will be in the background thread. The background thread is generally unknown to the application runtime. In VB6 one must be extremely careful in what is done within the event callback. For example, UI controls, such as text boxes, etc. should not be accessed from within a background thread. The UI controls should only be accessed from the UI (main) thread.

The same applies for DoEvents. Do not call DoEvents from a background thread.

Important: Never use asynchronous methods when there is no purpose. Specifically, if your application is calling the asynchronous method, and then simply waiting for it to complete (by spinning with a Sleep delay), then the better choice is to call the synchronous method with AbortCheck callbacks. This way all of your VB6 code runs in the main UI thread, including the AbortCheck callbacks.

This is bad:

Private WithEvents http As ChilkatHttp

Private Sub http_AbortCheck(abort As Long) ' This callback is running in a background (worker) thread when called ' from an asynchronous method that is itself running in a background thread. ' (the callback happens in the same thread as the caller) abort = 0 End Sub

Private Sub http_TaskCompleted(ByVal task As Chilkat_v9_5_0.IChilkatTask) ' This callback is running in a background (worker) thread when called ' from an asynchronous method. ' (the callback always happens in the same thread as the caller) End Sub ...

Public Function Something() Dim request as new ChilkatHttpRequest ... Dim task As ChilkatTask Set task = http.PostUrlEncodedAsync("https://somedomain.com/xyz/abc", request) If task.Run = 1 Then Do While task.Finished <> 1 task.SleepMs 100 DoEvents Loop End If

...

End Function

There is no point in running your code in a background thread if your code is simply spinning in the foreground thread to wait for completion. This is the equivalent of running synchronously -- but just more complicated and open to all sorts of other problems. Don't do it.

Simplify by calling the method synchronously, and use periodic AbortCheck callbacks (which are in the same thread as the caller -- i.e. the foreground main UI thread).

This is better:

Private WithEvents http As ChilkatHttp

Private Sub http_AbortCheck(abort As Long) ' This callback is running in the foreground thread (main UI thread) because it is called ' from a synchronous method call that is running in the main thread. abort = 0
' Call DoEvents here to keep the UI responsive... DoEvents
End Sub

...

Public Function Something() Dim request as new ChilkatHttpRequest ...

' Get AbortCheck callbacks every .1 seconds. http.HeartbeatMs = 100

Dim response as ChilkatHttpResponse Set response = http.PostUrlEncoded("https://somedomain.com/xyz/abc", request)

... End Function

Twofish encryption result differs from mcrypt

$
0
0

I'm making a call to a server with data encrypted with twofish using CBC mode. The server passes me back an error. Curious about this I wrote code in php and compared the hex values and to my surprise they were different. PHP code

$key = hex2bin("aa2db6350065070865ada5f1ac701c77");

$iv = hex2bin("cdb09c337e0a229405b20587da0ce2c8");

$input = "swagdragon@dabest.com";

$iv = hex2bin("cdb09c337e0a229405b20587da0ce2c8");

$ciphertext = mcrypt_encrypt(MCRYPT_TWOFISH, $key, $input, MCRYPT_MODE_CBC, $iv);

The result for this is: cf1337be982eaac26bcc9fcb912c68638bb1e51883996c652cb4b6a66eb44498

Same settings (256 key length) with the library gives: CF1337BE982EAAC26BCC9FCB912C6863E96FFCBC1985951DF1F16F98D7AF875F

How to Download Email Headers? Simple way to Decrypt?

$
0
0

Is there any fast way to get all headers of email (Chilkat.Email) ?
If I am looking to the Header property it contains raw header (they can be encrypted in Q or B string) Is there any simple way to get it decrypted?

Error/Bug in Chilkat lib crashing app when reading message body?

$
0
0

We are using the latest Android lib on our app. Works well. We recently received an email (apparently) that from what we can tell, is plain text... nothing special. Our APP is hard crashing all of a sudden.

Doing some internal debugging using Android Studio, my code cycles through a batch of messages, then the 12th message in, it "appears" to be hard crashing, internally, when retrieving the messages body from the server. The code works ok with date, subject, to, from, cc, bcc... no issues.

The code we have to retrieve the body is:

             if (email.HasHtmlBody())
                mystring=email.getHtmlBody();
            else
                mystring=email.getPlainTextBody();

As mentioned, this same routine works on multiple previous messages.. without an issue.

When I look at the error log in Android Studio, it says...

JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf0 ' in call to NewStringUTF from java.lang.String com.chilkatsoft.chilkatJNI.CkEmail_getPlainTextBody(long, com.chilkatsoft.CkEmail) "main" prio=5 tid=1 Runnable | group="main" sCount=0 dsCount=0 obj=0x736c3000 self=0xb4827800 | sysTid=25368 nice=0 cgrp=apps sched=0/0 handle=0xb6ff0bec | state=R schedstat=( 0 0 0 ) utm=33 stm=11 core=0 HZ=100 | stack=0xbe4ad000-0xbe4af000 stackSize=8MB | held mutexes= "mutator lock"(shared held) native: #00 pc 00004f60 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext)+23) native: #01 pc 00003665 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext)+8) native: #02 pc 00256a61 /system/lib/libart.so (art::DumpNativeStack(std::1::basic_ostream<char, std::__1::char_traits<char=""> >&, int, char const, art::mirror::ArtMethod)+84) native: #03 pc 00239617 /system/lib/libart.so (art::Thread::Dump(std::1::basic_ostream<char, std::__1::char_traits<char=""> >&) const+158) native: #04 pc 000b198b /system/lib/libart.so (art::JniAbort(char const, char const)+610) native: #05 pc 000b20c5 /system/lib/libart.so (art::JniAbortF(char const, char const, ...)+68) 0 native: #06 pc 000b467f /system/lib/libart.so (art::ScopedCheck::Check(bool, char const, ...) (.constprop.129)+922) 0 native: #07 pc 000be1ad /system/lib/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv, char const)+44) 0 native: #08 pc 00100d43 /data/app/com.retreve.retreve-1/lib/arm/libchilkatemail.so (_JNIEnv::NewStringUTF(char const)+8) 0 native: #09 pc 00110e19 /data/app/com.retreve.retreve-1/lib/arm/libchilkatemail.so (Java_com_chilkatsoft_chilkatJNI_CkEmail_1getPlainTextBody+20) native: #10 pc 00104ce5 /data/dalvik-cache/arm/data@app@com.retreve.retreve-1@base.apk@classes.dex (Java_com_chilkatsoft_chilkatJNI_CkEmail_1getPlainTextBody__JLcom_chilkatsoft_CkEmail_2+120) at com.chilkatsoft.chilkatJNI.CkEmail_getPlainTextBody(Native method)

Hopefully this makes sense to you guys because it doesn't appear to be anything we are doing wrong, I don't think.

Post HTTPS with Content-Type

$
0
0

When i tried post URL web with content-type : application/x-www-form-urlencoded. but it not working. i using request.ContentType = "application/x-www-form-urlencoded"; and set header, but both is not working, i am receving header with contentType:text/html. How to fix it ?

Http http = new Http();

        bool success;
        http.SocksHostname = "127.0.0.1";
        http.SocksPort = 50000;
        http.SocksVersion = 5;
        http.CookieDir = "memory";
        http.SaveCookies = true;
        http.SendCookies = true;
        //  Any string unlocks the component for the 1st 30-days.
        success = http.UnlockComponent("Anything for 30-day trial");
        if (success != true)
        {
            Console.WriteLine(http.LastErrorText);
            return;
        }

        HttpRequest request = new HttpRequest();
        request.ContentType = "application/x-www-form-urlencoded";
        //Content-Type: application/x-www-form-urlencoded
        //  Add the form parameters to the HTTP request:
        request.AddParam("_dyncharset", "ISO-8859-1");
        request.AddParam("_dynSessConf", "6268568803919292891");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.login", "tester@gmail.com");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.login", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.password", "123456");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.password", "+");
        request.AddParam("newStrongPassword", "");
        request.AddParam("_D%3AnewStrongPassword", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.login", "Submit");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.login", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.employeeProfile", "");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.employeeProfile", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "http%3A%2F%2Fwww.neimanmarcus.com%2Findex.jsp%3Fnavid%3DaccountLogout%26_requestid%3D385928");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "http%3A%2F%2Fwww.neimanmarcus.com%2Findex.jsp%3Fnavid%3DaccountLogout%26_requestid%3D385928");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "+");
        request.AddParam("_DARGS", "%2Fpage_rwd%2Faccount%2Flogin.jsp");

        //  Send the HTTP POST by calling PostUrlEncoded.
        //  The Content-Type used w/ the request will be application/x-www-form-urlencoded
        HttpResponse response = null;
        response = http.PostUrlEncoded("https://www.neimanmarcus.com/min.jsp?_DARGS=/page_rwd/account/login.jsp", request);
        if (response == null)
        {
            Console.WriteLine(http.LastErrorText);
            return;
        }
        string[] str;

        Console.WriteLine(response.Header + response.BodyStr);

C++ JSON Memory Management?

$
0
0

When constructing JSON parameter for Dropbox endpoint /upload_session/append_v2:

    CkJsonObject jsonParams;
    jsonParams.AddObjectAt(-1, “cursor");
    CkJsonObject *jsonCursor = jsonParams.ObjectOf(“cursor");
    jsonCursor->AddStringAt(-1, "session_id", sessionIdStr);
jsonParams correctly ends up with a nested “cursor” object containing “session_id”. So it appears that jsonParams and jsonCursor shares some memory. So we aren’t sure if we should we explicitly delete jsonCursor, or just let jsonParams goes out of scope and destructs.

HTTP ActiveX component error uploading to S3

$
0
0

I'm using the HTTP ActiveX component in a VBS script to upload files from the local system to Amazon S3. This has been in place and functioning properly for some time, but recently I began to notice issues.

In this specific case, I'm trying to upload a .rar file that's approx 3.9 GB.

The upload process starts when I call the S3_UploadFile method, runs for about 110 minutes and then returns the error linked below:

http://pastebin.com/4mUkdPyJ

I've tried uploading other files as small as a few KB and receive the same error.

How can I go about troubleshooting and correcting this issue?


TLS 1.2 causes failed connection

$
0
0

Upgrading to newest versions and getting the following error. Works fine with 2.0 but would like to upgrade to 4.6 framework.

With authTLS Enabled: ChilkatLog: Connect_Ftp2: DllDate: Jun 13 2016 ChilkatVersion: 9.5.0.58 UnlockPrefix: PACSFDFTP Architecture: Little Endian; 32-bit Language: Visual C++ 12.0 (32-bit) VerboseLogging: 0 ProgressMonitoring: enabled: yes heartbeatMs: 0 sendBufferSize: 65536 --ProgressMonitoring ImplicitSsl: 0 AuthTls: 1 AuthSsl: 1 ftpConnect: Hostname: safetrans.wellsfargo.com Port: 21 IdleTimeoutMs: 60000 socketOptions: SO_SNDBUF: 262144 SO_RCVBUF: 4194304 TCP_NODELAY: 1 SO_KEEPALIVE: 0 --socketOptions readCommandResponse: replyLineQP: 220 Welcome to Axway Gateway FTP server --readCommandResponse initialStatus: 220 initialResponse: 220 Welcome to Axway Gateway FTP server converting to secure connection... authTls: simpleCommand: sendCommand: sendingCommand: AUTH TLS --sendCommand readCommandResponse: replyLineQP: 234 Security data exchange complete. --readCommandResponse --simpleCommand clientHandshake: clientHandshake2: getPrivateKey: certGetPrivateKeyAsDER: toPrivKeyDer: This is a public key, not a private key. --toPrivKeyDer --certGetPrivateKeyAsDER Unable to export the private key. --getPrivateKey sendCertificateVerify: CertificateVerify using TLS 1.2 with MS Crypto API is not supported. Use TLS 1.1 or lower. --sendCertificateVerify Failed to send client certificate verify message. --clientHandshake2 --clientHandshake Client handshake failed. (1) connectionClosed: 0 Failed to convert channel to SSL/TLS --authTls --ftpConnect Failed to connect to FTP server. Failed. --Connect_Ftp2 --ChilkatLog

With authTls Disabled ChilkatLog: Connect_Ftp2: DllDate: Jun 13 2016 ChilkatVersion: 9.5.0.58 UnlockPrefix: PACSFDFTP Architecture: Little Endian; 32-bit Language: Visual C++ 12.0 (32-bit) VerboseLogging: 0 ProgressMonitoring: enabled: yes heartbeatMs: 0 sendBufferSize: 65536 --ProgressMonitoring ImplicitSsl: 0 AuthTls: 0 AuthSsl: 1 ftpConnect: Hostname: safetrans.wellsfargo.com Port: 21 IdleTimeoutMs: 60000 socketOptions: SO_SNDBUF: 262144 SO_RCVBUF: 4194304 TCP_NODELAY: 1 SO_KEEPALIVE: 0 --socketOptions readCommandResponse: replyLineQP: 220 Welcome to Axway Gateway FTP server --readCommandResponse initialStatus: 220 initialResponse: 220 Welcome to Axway Gateway FTP server converting to secure connection... authTls: simpleCommand: sendCommand: sendingCommand: AUTH SSL --sendCommand readCommandResponse: replyLineQP: 234 Security data exchange complete. --readCommandResponse --simpleCommand clientHandshake: clientHandshake2: getPrivateKey: certGetPrivateKeyAsDER: toPrivKeyDer: This is a public key, not a private key. --toPrivKeyDer --certGetPrivateKeyAsDER Unable to export the private key. --getPrivateKey sendCertificateVerify: CertificateVerify using TLS 1.2 with MS Crypto API is not supported. Use TLS 1.1 or lower. --sendCertificateVerify Failed to send client certificate verify message. --clientHandshake2 --clientHandshake Client handshake failed. (1) connectionClosed: 0 Failed to convert channel to SSL/TLS --authTls --ftpConnect Failed to connect to FTP server. Failed. --Connect_Ftp2 --ChilkatLog

Regsvr32: DllRegisterServer failed with error code 0x80070716

$
0
0

I ran the 64bit and 32bit bat on W2008 64bit server; however, I receive the following error …

RegSvr32
The Module “ChikatAx-9.5.0-win32.dll” was loaded but the call to DllRegisterServer failed with error code 0x80070716.
For more information about this problem, search online using the error code as a search term.

Is POP3 with SASL PLAIN authentication supported?

$
0
0

Hello,

is this supported (RFC 5034)?

AddFileAttachment issue with current release

$
0
0

Hi,

I just upgraded to the current Ck library (16 june, VC6 release) and am having trouble when I attach a file to an email. It looks like the email message body is contained in the file attachment.

A sample program is below:

   CkEmail emailToSend;
    emailToSend.put_Charset("utf-8");
    emailToSend.put_From("<me@example.com>");
    emailToSend.put_ReplyTo("<me@example.com>");
    emailToSend.AddMultipleTo("<myemail@gmail.com>");

emailToSend.put_Subject("cktest email");
CkString ctype;
fprintf(stdout, "addfileattach: %i\n", emailToSend.AddFileAttachment("c:\\temp\\attachme.txt", ctype));
emailToSend.put_Body("hello this is a cktest email");

fprintf(stdout, "sendemail: %i\n", _mailManager.SendEmail(emailToSend));
emailToSend.SaveEml("C:\\temp\\ckemail.eml");

There aree no errors reported. The contents of the saved eml is here:

MIME-Version: 1.0
Date: Tue, 26 Jul 2016 08:33:24 +0200
Message-ID: <8574E82A40D05EACBBE772364FFDD5FAF89A0CD6@WD4VPC>
Content-Type: multipart/mixed; boundary="------------050101090505080405050107"
X-Priority: 3 (Normal)
From: ........
CKX-Bounce-Address: ........
Reply-To: ........
To: .......
Subject: cktest email

--------------050101090505080405050107
Content-Type: text/plain; charset=utf-8; name="attachme.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="attachme.txt"

hello this is a cktest email
--------------050101090505080405050107--

As you can see the text "hello this is a cktest email" appears as the content of the attached file. This was the text I added as the message body.

The real content of the attached file (attachme.txt) is nowhere to be found inside the eml.

How to do simultaneous CkSocket_AcceptNextConnection

$
0
0

Hi,

Is it the right way and the best way to do an infinite loop wich accepts simultaneaous incoming connections in a server ?

It seems to crash with the non-blocking (asynchrounous) solution. That's why I am going to try with the blocking solution because the receive phase wich follows is in a thread

Best regards

Thanks

This the simplified code :

    if (!CkSocket_UnlockComponent(listenSocket,"mycode....")) 
     goto label_endloop ;

if (!CkSocket_BindAndListen(listenSocket,5001,32)) 
        goto label_endloop ;

label_startloop :

if (byChilkat == 2) // NOT BLOCKING
    {

task = CkSocket_AcceptNextConnectionAsync(listenSocket,0);
        if (CkSocket_getLastMethodSuccess(listenSocket) != TRUE) 
        {   ShowError ("Error CkSocket_AcceptNextConnectionAsync :", (char *)CkSocket_lastErrorText(listenSocket), FALSE) ;
            goto label_startloop ;
        }

if (!CkTask_Run(task)) 
        {    ShowError ("Error CkTask_Run (CkSocket_AcceptNextConnectionAsync) :", (char *)CkSocket_lastErrorText(listenSocket), FALSE) ;
            CkTask_Dispose(task);
            goto label_startloop ;
        }

while (CkTask_getFinished(task) != TRUE) 
            CkTask_SleepMs(task,10);    //  Sleep 10 ms.

status = CkTask_getStatusInt(task) ;
        if (status != 7) 
        {    ShowError ("Task (CkSocket_AcceptNextConnectionAsync) did not complete. Task status: ", (char *)CkTask_status(task), FALSE) ;
            CkTask_Dispose(task);
            goto label_startloop ;
        }

clientSocket = CkSocket_Create();
        if (!CkSocket_LoadTaskResult(clientSocket, task)) 
        {    ShowError ("CkSocket_LoadTaskResult", (char *)CkSocket_lastErrorText(clientSocket), FALSE) ;
            CkTask_Dispose(task);
            goto label_startloop ;
        }

CkTask_Dispose(task);
    }
    else    // BLOCKING
    {
         clientSocket = CkSocket_AcceptNextConnection(listenSocket, 0);
    }

hThreadSocketChilkatC = CreateThread(NULL, 0, ThreadSocketQuestionResponse, (LPVOID)&clientSocket, 0, &dwThreadId);

goto label_startloop ;

label_endloop :
Viewing all 1061 articles
Browse latest View live