Rawdata field

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Rawdata field

Alexey Zubko
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ QuickFIX Support: http://www.quickfixengine.org/services.html
Hello,

I need to send a binary data in a message and I put RawDataLength and RawData fields.
But sometimes I have a 'Could not convert field' exception during sending of the message.
Is there a limitation on data or is there a known problem in quickfix?

Thank you.

------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Quickfix-developers mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Caleb Epstein-3
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

On 5/27/05, Alexey Zubko <[hidden email]> wrote:

>  I need to send a binary data in a message and I put RawDataLength and
> RawData fields.
>  But sometimes I have a 'Could not convert field' exception during sending
> of the message.
>  Is there a limitation on data or is there a known problem in quickfix?

Which version of QuickFIX?  There were bugs in versions prior to 1.9.3
when messages contained embedded \0 bytes, even in data fields.

--
Caleb Epstein
caleb dot epstein at gmail dot com


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Alexey Zubko
Caleb,

I use the last version - 1.9.4.
I sent FIX42::News message with RawData field filled with a random value.
When the data was -92 I got the problem.
Note it happened not on the first messages.

I'm sorry I have no time to debug the code by myself right now.
Let me know if you need more details.

Regards,
		Alexey Zubko


Caleb Epstein wrote:
On 5/27/05, Alexey Zubko [hidden email] wrote:

  
 I need to send a binary data in a message and I put RawDataLength and
RawData fields.
 But sometimes I have a 'Could not convert field' exception during sending
of the message.
 Is there a limitation on data or is there a known problem in quickfix?
    

Which version of QuickFIX?  There were bugs in versions prior to 1.9.3
when messages contained embedded \0 bytes, even in data fields.

  
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Caleb Epstein-3
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

On 5/31/05, Alexey Zubko <[hidden email]> wrote:

>  I use the last version - 1.9.4.
>  I sent FIX42::News message with RawData field filled with a random value.
>  When the data was -92 I got the problem.
>  Note it happened not on the first messages.

Session logfiles (and optionally code) might help to debug this.  Not
sure what you mean by the value of RawData being "-92".  Is this the
actual string value?

--
Caleb Epstein
caleb dot epstein at gmail dot com


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Alexey Zubko
Caleb,

Here is the client code:

void CClnApp::SendData(char c)
{
    FIX::Headline    headline = "client";

    FIX42::News        msg(headline);

    FIX::RawDataLength    data_len = rand() % 100;
    FIX::RawData        data;

    std::string        s;
    char cc = -92; //c;//rand() % 255;
    s.assign(data_len, cc);

    data.setValue(s);

    msg.set(data_len);
    msg.set(data);

    Send(msg);
}

Enclosed are the logs.


Regards,
		Alexey Zubko


Caleb Epstein wrote:
On 5/31/05, Alexey Zubko [hidden email] wrote:

  
 I use the last version - 1.9.4.
 I sent FIX42::News message with RawData field filled with a random value.
 When the data was -92 I got the problem.
 Note it happened not on the first messages.
    

Session logfiles (and optionally code) might help to debug this.  Not
sure what you mean by the value of RawData being "-92".  Is this the
actual string value?

  

FIX.4.2-TM_TORONTO-EM_TM_SRV.incoming (57K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Caleb Epstein-3
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

On 5/31/05, Alexey Zubko <[hidden email]> wrote:

>  Enclosed are the logs.

I actually get crashes trying to send the last message in that
.outgoing file (the one with the 0xA4 bytes in RawData).  It looks
like the CheckSum calculation gets messed up by high-bit ASCII
characters and goes negative, which is out-of-spec.  This patch fixes
the problem.

diff -u -b -u -p -r1.18 Field.h
--- Field.h     28 Dec 2004 15:23:26 -0000      1.18
+++ Field.h     31 May 2005 15:44:37 -0000
@@ -121,7 +121,10 @@ private:
       m_length = m_data.length();
     }
 
-    const char* iter = m_data.c_str();
+    // Treat strings as unsigned in case values contain high-bit
+    // chars.  Don't want checksum to go negative.
+    const unsigned char* iter =
+        reintepret_cast<const unsigned char*> (m_data.c_str());
     m_total = std::accumulate( iter, iter + m_length, 0 );
 
     m_calculated = true;

--
Caleb Epstein
caleb dot epstein at gmail dot com


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Alexey Zubko
Caleb,

Thank you. The patch solved the problem.


P.S.
Misspelling: reinterpret_cast

Regards,
		Alexey Zubko

Caleb Epstein wrote:
On 5/31/05, Alexey Zubko [hidden email] wrote:

  
 Enclosed are the logs.
    

I actually get crashes trying to send the last message in that
.outgoing file (the one with the 0xA4 bytes in RawData).  It looks
like the CheckSum calculation gets messed up by high-bit ASCII
characters and goes negative, which is out-of-spec.  This patch fixes
the problem.

diff -u -b -u -p -r1.18 Field.h 
--- Field.h     28 Dec 2004 15:23:26 -0000      1.18 
+++ Field.h     31 May 2005 15:44:37 -0000 
@@ -121,7 +121,10 @@ private: 
       m_length = m_data.length(); 
     } 
  
-    const char* iter = m_data.c_str(); 
+    // Treat strings as unsigned in case values contain high-bit 
+    // chars.  Don't want checksum to go negative. 
+    const unsigned char* iter = 
+        reintepret_cast<const unsigned char*> (m_data.c_str()); 
     m_total = std::accumulate( iter, iter + m_length, 0 ); 
  
     m_calculated = true; 

  
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Caleb Epstein-3
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

>  Misspelling: reinterpret_cast

Oops.   I guess I should have compiled it first :)

--
Caleb Epstein
caleb dot epstein at gmail dot com


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: Rawdata field

Oren Miller
In reply to this post by Alexey Zubko
Caleb's patch has been checked into CVS along with a unit test based on your code.
 
--oren
----- Original Message -----
Sent: Tuesday, May 31, 2005 11:15 AM
Subject: Re: [Quickfix-developers] Rawdata field

Caleb,

Thank you. The patch solved the problem.


P.S.
Misspelling: reinterpret_cast

Regards,
		Alexey Zubko

Caleb Epstein wrote:
On 5/31/05, Alexey Zubko [hidden email] wrote:

  
 Enclosed are the logs.
    

I actually get crashes trying to send the last message in that
outgoing file (the one with the 0xA4 bytes in RawData).  It looks.
like the CheckSum calculation gets messed up by high-bit ASCII
characters and goes negative, which is out-of-spec.  This patch fixes
the problem.

diff -u -b -u -p -r1.18 Field.h 
--- Field.h     28 Dec 2004 15:23:26 -0000      1.18 
+++ Field.h     31 May 2005 15:44:37 -0000 
@@ -121,7 +121,10 @@ private: 
       m_length = m_data.length(); 
     } 
  
-    const char* iter = m_data.c_str(); 
+    // Treat strings as unsigned in case values contain high-bit 
+    // chars.  Don't want checksum to go negative. 
+    const unsigned char* iter = 
+        reintepret_cast<const unsigned char*> (m_data.c_str()); 
     m_total = std::accumulate( iter, iter + m_length, 0 ); 
  
     m_calculated = true;