command processor and XML input

Discussion to talk about software related topics only.
Post Reply
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

command processor and XML input

Post by ckoehler »

Hi,

I am having some trouble sending XML through the command processor. Here's what the command is when I debug the char pointer in GDB, and the XML I am sending:

https://gist.github.com/df72eb72fa7df63c02dd

The "6 " before the command just tells it what to do and (I guess) can be ignored. Notice how some of the middle part of the XML is cut off, but the last two chars are there (the "d>").

Any ideas? I am thinking about just going back to simple sockets and making up my own way of sending and receiving; would that be a better way?
Is there a length limit on the const char* for the command?

Thanks!

Christoph
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: command processor and XML input

Post by tod »

Notice how it seems to go awry at the end of the first quoted attribute? Seems like your problem might be related to escaping the quote marks. Rather than abandon your xml approach I would probably experiment with sending some long simple commands without quotes to make sure the length isn't the issue. Then maybe try constructing the XML without attributes so you don't need to escape the quotes. If that all works and you really want to use the quoted attributes you will be much closer to knowing what is going wrong.
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

Re: command processor and XML input

Post by ckoehler »

Good tips, thanks, will give that a shot.
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

Re: command processor and XML input

Post by ckoehler »

Looks like there's a limit on length. The command is truncated after 78 characters. The odd thing is that the first 76 characters are in order, but the last two are exactly the last two characters of the whole command. So some way or another, the command processor knows about the whole command, just doesn't stick it into the const char array.

Is there any way around that?

The way it looks I will probably have to scrap the command processor and do some custom socket stuff.

Thanks!

Christoph
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

Re: command processor and XML input

Post by ckoehler »

I ended up scrapping the command processor and doing a simple socket thing, and it works beautifully!

Thanks for all the pointers!

Christoph
Post Reply